Class Implements
- All Implemented Interfaces:
Invoke
,Serializable
,Remote
When a service is remoted, wrapped in this object; clients can invoke the methods they assume this object implements. Instead of the normal method return; it will return a boolean. True will indicate that the service supports the method, otherwise it will return false. No side effects to the wrapped object will be incurred by this service. In fact; the service object will be completely unaware of the testing.
One suggested protocol: A service object could provide a public getImplements(); method, which would return a remote reference to the service object, wrapped by an Implements instance. A new reference needn't be created for each call, and in fact, the reference can even be instantiated lazily, i.e. if needed.
As a template:
private Remote myImplements; public RemoteInvoke getImplements() throws java.rmi.RemoteException { return myImplements == null ? myImplements = new Remote(new Implements(this)) : myImplements; }
- Version:
- 1.0, 03-Apr-07
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionImplements
(Object service) The constructor takes any service object, and allows it to be remotely tested for method existence, without having to invoke it. -
Method Summary
-
Field Details
-
service
-
-
Constructor Details
-
Implements
The constructor takes any service object, and allows it to be remotely tested for method existence, without having to invoke it.- Parameters:
service
- The service object to make remotely testable for method callability.
-
-
Method Details
-
invoke
Instead of actually invoking the method on the target object, this object will test for the existence of the method on the target object, either and return true or false.- Specified by:
invoke
in interfaceInvoke
- Parameters:
method
- The method to check for existenceargs
- The signature of the particular method would accept, the arguments can be null, or subclasses of the expected arguments. Typically these are represented by class, but they also can be passed in by instance.- Returns:
- Instead of the method's normal return, if any, it will be true if the service supports this method and signature, otherwise false.
-