@Override public String toString() { DBR value = null; if (event != null) { value = event.getDBR(); } return "Metadata " + metadata + " value " + value; }
public void contextException(ContextExceptionEvent arg0) { String message = arg0.getMessage(); System.err.println(message); System.err.flush(); } /* (non-Javadoc)
public void contextMessage(ContextMessageEvent arg0) { String message = arg0.getMessage(); System.out.println(message); System.out.flush(); } }
/** * Set connection state and if changed, notifies listeners. * @param newState state to set. */ private synchronized void setConnectionState(ConnectionState connectionState) { if (this.connectionState != connectionState) { this.connectionState = connectionState; boolean connectionStatusToReport = (connectionState == ConnectionState.CONNECTED); if (connectionStatusToReport != lastReportedConnectionState) { lastReportedConnectionState = connectionStatusToReport; synchronized (connectionListeners) { context.getEventDispatcher().dispatch( new ConnectionEvent(this, connectionStatusToReport), connectionListeners ); } } } }
/** * @see com.cosylab.epics.caj.impl.ResponseRequest#timeout() */ public void timeout() { cancel(); // ... and notify context.getEventDispatcher().dispatch( new MonitorEvent(channel, null, CAStatus.TIMEOUT), monitor ); }
/** * @see com.cosylab.epics.caj.impl.ResponseRequest#timeout() */ public void timeout() { // do not decrement pending IO, if non-callback read is used prohibitIOCancel = true; cancel(); // ... and notify if (callback != null) context.getEventDispatcher().dispatch( new GetEvent(channel, null, CAStatus.TIMEOUT), callback ); }
/** * Set access rights. * @param accessRights access rights to set */ public synchronized void setAccessRights(int accessRights) { if (this.accessRights != accessRights) { this.accessRights = accessRights; // do not use access rights accessors since they check state boolean readAccess = (accessRights & CAConstants.CA_PROTO_ACCESS_RIGHT_READ) != 0; boolean writeAccess = (accessRights & CAConstants.CA_PROTO_ACCESS_RIGHT_WRITE) != 0; synchronized (accessRightsListeners) { context.getEventDispatcher().dispatch( new AccessRightsEvent(this, readAccess, writeAccess), accessRightsListeners ); } } }
/** * @see gov.aps.jca.event.MonitorListener#monitorChanged(gov.aps.jca.event.MonitorEvent) */ public void monitorChanged(MonitorEvent ev) { context.getEventDispatcher().dispatch(ev, listeners); }
public void connectionChanged(ConnectionEvent event) { if (event.isConnected()) initializeMonitor(); }
/** * Set connection state and if changed, notifies listeners. * @param newState state to set. */ private synchronized void setConnectionState(ConnectionState connectionState) { if (this.connectionState != connectionState) { this.connectionState = connectionState; boolean connectionStatusToReport = (connectionState == ConnectionState.CONNECTED); if (connectionStatusToReport != lastReportedConnectionState) { lastReportedConnectionState = connectionStatusToReport; synchronized (connectionListeners) { context.getEventDispatcher().dispatch( new ConnectionEvent(this, connectionStatusToReport), connectionListeners ); } } } }
/** * @see com.cosylab.epics.caj.impl.ResponseRequest#timeout() */ public void timeout() { cancel(); // ... and notify context.getEventDispatcher().dispatch( new MonitorEvent(channel, null, CAStatus.TIMEOUT), monitor ); }
/** * @see com.cosylab.epics.caj.impl.ResponseRequest#timeout() */ public void timeout() { // do not decrement pending IO, if non-callback read is used prohibitIOCancel = true; cancel(); // ... and notify if (callback != null) context.getEventDispatcher().dispatch( new GetEvent(channel, null, CAStatus.TIMEOUT), callback ); }
/** * Set access rights. * @param accessRights access rights to set */ public synchronized void setAccessRights(int accessRights) { if (this.accessRights != accessRights) { this.accessRights = accessRights; // do not use access rights accessors since they check state boolean readAccess = (accessRights & CAConstants.CA_PROTO_ACCESS_RIGHT_READ) != 0; boolean writeAccess = (accessRights & CAConstants.CA_PROTO_ACCESS_RIGHT_WRITE) != 0; synchronized (accessRightsListeners) { context.getEventDispatcher().dispatch( new AccessRightsEvent(this, readAccess, writeAccess), accessRightsListeners ); } } }
@Override public String toString() { DBR value = null; if (event != null) { value = event.getDBR(); } return "Metadata " + metadata + " value " + value; }
/** * @see gov.aps.jca.event.MonitorListener#monitorChanged(gov.aps.jca.event.MonitorEvent) */ public void monitorChanged(MonitorEvent ev) { context.getEventDispatcher().dispatch(ev, listeners); }
public void connectionChanged(ConnectionEvent event) { if(!event.isConnected()) { putDone(disconnectedWhileActiveStatus); getDone(disconnectedWhileActiveStatus); } else { initializePut(); } }
/** * @see gov.aps.jca.Channel#addConnectionListener(gov.aps.jca.event.ConnectionListener) */ public synchronized void addConnectionListenerAndFireIfConnected(ConnectionListener l) throws CAException, IllegalStateException { checkNotClosedState(); if (l == null) throw new IllegalArgumentException("l == null"); if (connectionState == ConnectionState.CONNECTED) context.getEventDispatcher().dispatch(new ConnectionEvent(this, true), l); addConnectionListener(l); }
/** * @see gov.aps.jca.Channel#addConnectionListener(gov.aps.jca.event.ConnectionListener) */ public synchronized void addConnectionListenerAndFireIfConnected(ConnectionListener l) throws CAException, IllegalStateException { checkNotClosedState(); if (l == null) throw new IllegalArgumentException("l == null"); if (connectionState == ConnectionState.CONNECTED) context.getEventDispatcher().dispatch(new ConnectionEvent(this, true), l); addConnectionListener(l); }