/** * @see gov.aps.jca.event.MonitorListener#monitorChanged(gov.aps.jca.event.MonitorEvent) */ public void monitorChanged(MonitorEvent ev) { context.getEventDispatcher().dispatch(ev, listeners); }
eventDispatcher.dispose();
eventDispatcher.dispose();
/** * @see gov.aps.jca.event.MonitorListener#monitorChanged(gov.aps.jca.event.MonitorEvent) */ public void monitorChanged(MonitorEvent ev) { context.getEventDispatcher().dispatch(ev, listeners); }
/** * 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 ); } } }
/** * 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 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 com.cosylab.epics.caj.impl.ResponseRequest#timeout() */ public void timeout() { cancel(); // ... and notify context.getEventDispatcher().dispatch( new MonitorEvent(channel, null, CAStatus.TIMEOUT), monitor ); }
/** * 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 ); } } }
/** * 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 if (callback != null) context.getEventDispatcher().dispatch( new PutEvent(channel, DBRType.UNKNOWN, 0, CAStatus.TIMEOUT), callback ); }
/** * @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 com.cosylab.epics.caj.impl.ResponseRequest#timeout() */ public void timeout() { cancel(); // ... and notify if (callback != null) context.getEventDispatcher().dispatch( new PutEvent(channel, DBRType.UNKNOWN, 0, CAStatus.TIMEOUT), callback ); }
/** * @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 ); }
/** * @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 ); }
/** * @see com.cosylab.epics.caj.impl.NotifyResponseRequest#response(int, short, int, java.nio.ByteBuffer) */ public void response( int status, short dataType, int dataCount, ByteBuffer dataPayloadBuffer) { try { if (callback != null) { DBRType type = DBRType.forValue(dataType); CAStatus caStatus = CAStatus.forStatusCode(status); // notify context.getEventDispatcher().dispatch( new PutEvent(channel, type, dataCount, caStatus), callback ); } } finally { // allways cancel request cancel(); } }
context.getEventDispatcher().dispatch( new MonitorEvent(channel, readVal, caStatus), monitor
context.getEventDispatcher().dispatch( new GetEvent(channel, dbr, caStatus), callback
context.getEventDispatcher().dispatch( new MonitorEvent(channel, readVal, caStatus), monitor