solar.service.pubsub.client
Class PubSubClient

java.lang.Object
  |
  +--solar.service.pubsub.client.PubSubClient

public class PubSubClient
extends java.lang.Object

The facade class to interact with Solar system for Pub/Sub service.

Version:
$Id: PubSubClient.java,v 1.6 2003/10/12 00:58:39 glchen Exp $
Author:
Guanling Chen

Field Summary
private  DispatchService _dispatch
           
protected static org.apache.log4j.Logger _log
           
private  PubSubService _pubsub
           
 
Constructor Summary
PubSubClient(serp.util.Options opts)
           
PubSubClient(java.lang.String cfg)
           
PubSubClient(java.lang.String host, int port)
           
PubSubClient(java.lang.String host, int port, serp.util.Options opts)
           
 
Method Summary
 void addPublisher(Id pubId, Publisher publisher)
           
 void addSubscriber(Id subId, Subscriber subscriber)
           
private  void construct(serp.util.Options opts)
          Common operations needed by constructors.
private  serp.util.Options getDefaultOptions()
           
static void main(java.lang.String[] args)
          Start the client and make name lookups.
 void publish(Id pubId, Event evt)
           
 void subscribe(Id pubId, Id subId, java.lang.Object extra)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

protected static org.apache.log4j.Logger _log

_dispatch

private DispatchService _dispatch

_pubsub

private PubSubService _pubsub
Constructor Detail

PubSubClient

public PubSubClient(java.lang.String host,
                    int port)
             throws java.lang.Exception

PubSubClient

public PubSubClient(java.lang.String host,
                    int port,
                    serp.util.Options opts)
             throws java.lang.Exception

PubSubClient

public PubSubClient(java.lang.String cfg)
             throws java.lang.Exception

PubSubClient

public PubSubClient(serp.util.Options opts)
             throws java.lang.Exception
Method Detail

getDefaultOptions

private serp.util.Options getDefaultOptions()

construct

private void construct(serp.util.Options opts)
                throws java.lang.Exception
Common operations needed by constructors.

java.lang.Exception

addPublisher

public void addPublisher(Id pubId,
                         Publisher publisher)
                  throws java.lang.Exception
java.lang.Exception

addSubscriber

public void addSubscriber(Id subId,
                          Subscriber subscriber)
                   throws java.lang.Exception
java.lang.Exception

subscribe

public void subscribe(Id pubId,
                      Id subId,
                      java.lang.Object extra)
               throws java.lang.Exception
java.lang.Exception

publish

public void publish(Id pubId,
                    Event evt)
             throws java.lang.Exception
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Start the client and make name lookups. Command line usage:

-host tahoe -port 5470

java.lang.Exception