All Packages Class Hierarchy This Package Previous Next Index
Class SE.kth.speech.broker.BrokerClass
SE.kth.speech.broker.BrokerClass
- public class BrokerClass
- implements BrokerObject
A class representing classes of objects stored in a Broker component, and
accessed over the network.
- See Also:
- BrokerObject
-
BrokerClass(String, Class)
-
-
BrokerClass(String, String)
-
-
addInstance(BrokerObject)
-
-
addPackage(String)
- Specify a java package which will be searched when an unknown class is
requested.
-
classDoCommand(BrokerClient, String)
- Parses incoming broker calls and dispatches them to the appropriate class.
-
classDoCommand(BrokerClient, String, BrokerTokenizer, BrokerTokenizer, Vector)
- Dispatch a call to the proper BrokerClass or BrokerObject.
-
classDoCommand(BrokerClient, Vector)
- Parses incoming broker multiline calls and dispatches them to the
appropriate class.
-
count()
-
-
delete(BrokerObject)
-
-
doCommand(BrokerClient, BrokerTokenizer, BrokerTokenizer, Vector)
-
-
getAllLock()
-
-
getBrokerClass()
-
-
getBrokerObjectId()
-
-
getBrokerObjectId()
- Return an identifier for this object, which is unique within the
BrokerClass.
-
getByName(String)
-
-
getClassByName(String)
- Return the BrokerClass with the specified name.
-
getInstanceClass()
-
-
getInstances()
-
-
getName()
-
-
instanceDoCommand(BrokerObject, BrokerClient, BrokerTokenizer, BrokerTokenizer, Vector)
-
-
instanceToString(BrokerObject)
- Returns a string of the form : for a given Broker Object.
-
parseBrokerObject(String)
- Returns the specified BrokerObject if it exists.
BrokerClass
public BrokerClass(String nm,
String className)
BrokerClass
public BrokerClass(String nm,
Class instanceC)
addPackage
public static void addPackage(String name)
- Specify a java package which will be searched when an unknown class is
requested.
A problem with the BrokerClass/BrokerObject magic is that a class will not
be loaded into the Java interpreter until it is explicitly used.
Classes which are only accessed from Broker calls may never explicitly
referred to in the actual server, only through reflection calls.
This documentation needs to be finished***
- Parameters:
- name - The package name, for instance
"SE.kth.speech.broker.modules.registry"
getClassByName
public static BrokerClass getClassByName(String name)
- Return the BrokerClass with the specified name.
This method attempts to load a java-class with the same name in each
of the packages in the package-path if no class with the specified name
is found.
- Parameters:
- name - the name of the BrokerClass (not neccessarily the name of the
java class)
- Returns:
- s the BrokerClass of the named class
parseBrokerObject
public static BrokerObject parseBrokerObject(String str) throws BrokerException
- Returns the specified BrokerObject if it exists. The input is of the form
class:instance
Throws a BrokerException if the input is of the wrong form or if the class
doesn't exist.
Returns null if the class exists, but the given instance doesn't.
- Parameters:
- str - A string of the form 'class:instance' where class is a
BrokerClass, and instance the id of an instance of that class.
- Returns:
- The BrokerObject specified by the string.
- Throws: BrokerException
- if the input is of the wrong form, or the class
doesn't exist.
instanceToString
public static String instanceToString(BrokerObject o)
- Returns a string of the form : for a given Broker Object.
- Parameters:
- o - The object
classDoCommand
public static Object classDoCommand(BrokerClient broker,
String message) throws BrokerException
- Parses incoming broker calls and dispatches them to the appropriate class.
Intended to be called from the brokerCall functions of the ServiceProvider
classDoCommand
public static Object classDoCommand(BrokerClient broker,
Vector message) throws BrokerException
- Parses incoming broker multiline calls and dispatches them to the
appropriate class.
Intended to be called from the brokerCall functions of the
ServiceProvider.
This method expects the vector to have at least one element. The first
element of the vector is expected to be a line of one of the following
forms:
:
:.
- Throws: BrokerException
- if the call resulted in an error
- See Also:
- classDoCommand, brokerCall
classDoCommand
public static Object classDoCommand(BrokerClient broker,
String objName,
BrokerTokenizer identifierTok,
BrokerTokenizer commandTok,
Vector hector) throws BrokerException
- Dispatch a call to the proper BrokerClass or BrokerObject.
- Parameters:
- broker - The broker connection that the call came in on
- objName - a String of the form or :
- identifierTok - a BrokerTokenizer on the part of the object identifier
that follows the '.', that is, the attribute part of the description
:.
- commandTok - a BrokerTokenizer on the part of the message which
follows the object identifier, that is, in a message of the form
:. the commandTok will be on the
and
- hector - The rest of the lines in a multiline call, or null if it was
an INLINE call.
- Returns:
- s The result of the call, which must be an object of the type that
the brokerCall of a ServiceProvider may return (normally a String or a
Vector of Strings)
- Throws: BrokerException
- if the call results in an error, or is of the
wrong form.
- See Also:
- ServiceProvider
getBrokerObjectId
public String getBrokerObjectId()
getBrokerClass
public BrokerClass getBrokerClass()
delete
public void delete(BrokerObject o)
addInstance
public void addInstance(BrokerObject bo)
getAllLock
public Object getAllLock()
getByName
public BrokerObject getByName(String name)
getName
public String getName()
getInstanceClass
public Class getInstanceClass()
getInstances
public CollectionPublication getInstances()
count
public int count()
doCommand
public Object doCommand(BrokerClient broker,
BrokerTokenizer identifierTok,
BrokerTokenizer commandTok,
Vector hector) throws BrokerException
instanceDoCommand
public Object instanceDoCommand(BrokerObject instance,
BrokerClient broker,
BrokerTokenizer identifierTok,
BrokerTokenizer commandTok,
Vector hector) throws BrokerException
All Packages Class Hierarchy This Package Previous Next Index