|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.cajo.Cajo
public final class Cajo
This class implements the Generic Standard Interface using the cajo library. It is designed to work with all JRE's: 1.3 and higher.
Constructor Summary | |
---|---|
Cajo()
The defaule constructor announces the cajo object on the cajo IANA standard address and port, with a default ttl value of 16. |
|
Cajo(int ttl)
This constructor announces the cajo object on the cajo IANA standard address and port using a specific ttl value. |
Method Summary | |
---|---|
void |
export(java.lang.Object object)
This method makes any object's public methods, whether instance or static, remotely invocable. |
void |
export(java.lang.Object object,
java.lang.Object target)
This method makes any object's public methods, whether instance or static, remotely invocable. |
java.lang.Object[] |
lookup(java.lang.Class methodSetInterface)
This method finds all remotely invocable objects, supporting the specified method set. |
static void |
main(java.lang.String[] args)
Technically this method is unrelated to the class, it is used to furnish library version information. |
static java.lang.Object |
proxy(java.lang.Object object)
This method is used to allow clients to pass references to its own local objects, to other JVMs. |
java.lang.Object |
proxy(java.lang.Object reference,
java.lang.Class methodSetInterface)
This method instantiates a Dynamic Proxy at the client, which implements the method set specified. |
void |
register(java.lang.String hostname,
int port)
This method is used to manually collect remote registry entries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cajo() throws java.io.IOException
java.io.IOException
- If the startup announcement datagram packet could
not be sentpublic Cajo(int ttl) throws java.io.IOException
ttl
- The time for interface export announcements to live,
it is decremented each time it is passed to a new router, a value of 0
confines the announcement to the local subnet, the max value of 255
could theoretically traverse the entire internet (assuming no routers
blocked datagram packets)
java.io.IOException
- If the startup announcement datagram packet could
not be sentMethod Detail |
---|
public void export(java.lang.Object object) throws java.io.IOException
Note: if an object is exported more than once, it will be registered each time, you generally do not want to do this. Also, if you plan to use the register method, to contact remote registries directly, it is highly advisible to export all objects prior to doing so.
export
in interface Grail
object
- The
POJO to be made remotely invocable, i.e. there is no requirement
for it to implement any special interfaces, nor to be derived from any
particular class
java.io.IOException
- If the announcement datagram packet could not be
sentpublic void export(java.lang.Object object, java.lang.Object target) throws java.io.IOException
Note: if an object is exported more than once, it will be registered each time, you generally do not want to do this. Also, if you plan to use the register method, to contact remote registries directly, it is highly advisible to export all objects prior to doing so.
object
- The
POJO to be made remotely invocable, i.e. there is no requirement
for it to implement any special interfaces, nor to be derived from any
particular classtarget
- The object on which to invoke methods, this is used when
object parameter is wrapped e.g. in a MonitorItem or AuditorItem
java.io.IOException
- If the announcement datagram packet could not be
sentpublic java.lang.Object[] lookup(java.lang.Class methodSetInterface) throws java.lang.Exception
lookup
in interface Grail
methodSetInterface
- The interface of methods that remote objects
are required to support
java.lang.Exception
- For any network or framework specific reasonspublic java.lang.Object proxy(java.lang.Object reference, java.lang.Class methodSetInterface)
proxy
in interface Grail
reference
- A reference to a remote object returned by the
lookup method of this interface, though actually, any object reference
implementing the client method set would workmethodSetInterface
- The set (or subset) of public methods,
static or instance, that the object reference implements
public static java.lang.Object proxy(java.lang.Object object) throws java.rmi.RemoteException
object
- The local client object for which a pass-by-reference is
sought (if the reference has not been already remoted, it will be)
java.rmi.RemoteException
- If the remoting of the object, when necessary,
fails, typically due to network configuration issuespublic void register(java.lang.String hostname, int port) throws java.lang.Exception
hostname
- The address or domain name of a remote grail JVMport
- The TCP port on which the object is being shared,
canonically it 1198
java.lang.Exception
- Various types, related to network related errors:
invalid host name, host unavailable, host unreachable, etc...public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
- If the readme.txt file cannot be found
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |