|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcern.cmw.rda.client.ReplyAdapter
public abstract class ReplyAdapter
An abstract class for receiving replies to asynchronous calls or subscription
reports.
This class exists as convenience for creating objects that implement the ReplyHandler
interface.
If you implement the ReplyHandler interface, you have to define all of the methods
in it. This class provides simple default implementations for them all, so you can
only define methods for the kinds of replies you care about. It also defines a new
method
to which all calls to the overloaded handleException
methods are forwarded by default. Use (override) this method if you can use the same
exception handling procedure for all kinds of exceptions, or for some of them.
Example:
//
// Print a message for all kinds of exceptions except for IOError which needs
// a special treatment.
//
class ErrorListener extends ReplyAdapter
{
void handleException(Request request, IOError exception)
{
//
// handle IOError in a special way
//
}
void handleError(Request request, CmwException exception)
{
DeviceHandle dh = request.getDeviceHandle();
System.out.println("==> call to "
+ dh.getDeviceName() +"/"
+ request.getPropertyName() +"/"
+ request.getCycleSelector() +" failed");
System.out.println(" "+ exception);
}
}
ReplyHandler
Constructor Summary | |
---|---|
ReplyAdapter()
|
Method Summary | |
---|---|
void |
cancelled(SubscriptionRequest request)
Invoked when a data subscription is cancelled by a monitorOff call. |
void |
disconnected(SubscriptionRequest request)
Invoked when a subscription is suspended because of a lost connection to a remote device; for example, because the device server is down. |
void |
done(SetRequest request)
Invoked when a set call completes successfully. |
void |
handleError(Request request,
CmwException exception)
This method is called by default implementations of the handleException methods. |
void |
handleException(Request request,
BadParameter exception)
Invoked on receipt of a reply containing the specified exception. |
void |
handleException(Request request,
InternalException exception)
Invoked on receipt of a reply containing the specified exception. |
void |
handleException(Request request,
IOError exception)
Invoked on receipt of a reply containing the specified exception. |
void |
handleException(Request request,
LostUpdates exception)
Invoked on reception of a reply containing information about lost updates. |
void |
handleException(Request request,
NoConnection exception)
Invoked if the connection to the device server has been lost while waiting for the reply. |
void |
handleException(Request request,
NoPermission exception)
Invoked on reception of a reply containing the RBAC-related exception. |
void |
handleException(Request request,
TimeOut exception)
Invoked if no reply to the request has been received within a certain time limit. |
void |
handleReply(Request request,
Data value)
Invoked when a property value is delivered as a result of a successful get or monitorOn call. |
void |
reconnected(SubscriptionRequest request)
Invoked when a suspended subscription has been resumed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplyAdapter()
Method Detail |
---|
public void handleReply(Request request, Data value)
get
or monitorOn
call.
The value
Data may change after the call returns:
make a copy of the Data object if you need to store it in your
application.
Implementation: empty.
handleReply
in interface ReplyHandler
public void done(SetRequest request)
set
call completes successfully.
Implementation: empty.
done
in interface ReplyHandler
public void disconnected(SubscriptionRequest request)
Implementation: empty.
disconnected
in interface ReplyHandler
ReplyHandler.reconnected(cern.cmw.rda.client.SubscriptionRequest)
public void reconnected(SubscriptionRequest request)
Implementation: empty.
reconnected
in interface ReplyHandler
ReplyHandler.disconnected(cern.cmw.rda.client.SubscriptionRequest)
public void cancelled(SubscriptionRequest request)
monitorOff
call.
Implementation: empty.
cancelled
in interface ReplyHandler
public void handleException(Request request, BadParameter exception)
Implementation: calls handleError(cern.cmw.rda.client.Request, cern.cmw.CmwException)
with the specified parameters.
handleException
in interface ReplyHandler
public void handleException(Request request, TimeOut exception)
Implementation: calls handleError(cern.cmw.rda.client.Request, cern.cmw.CmwException)
with the specified parameters.
handleException
in interface ReplyHandler
public void handleException(Request request, NoConnection exception)
Implementation: calls handleError(cern.cmw.rda.client.Request, cern.cmw.CmwException)
with the specified parameters.
handleException
in interface ReplyHandler
public void handleException(Request request, IOError exception)
Implementation: calls handleError(cern.cmw.rda.client.Request, cern.cmw.CmwException)
with the specified parameters.
handleException
in interface ReplyHandler
public void handleException(Request request, InternalException exception)
Implementation: calls ReplyAdapter##handleError
with the specified parameters.
handleException
in interface ReplyHandler
public void handleException(Request request, NoPermission exception)
Implementation: calls ReplyAdapter##handleError
with the specified parameters.
handleException
in interface ReplyHandler
public void handleException(Request request, LostUpdates exception)
Implementation: calls ReplyAdapter##handleError
with the specified parameters.
handleException
in interface ReplyHandler
public void handleError(Request request, CmwException exception)
Implementation: empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |