Class RunnableDeviceServiceProxy
java.lang.Object
org.eclipse.scanning.event.remote.RunnableDeviceServiceProxy
- All Implemented Interfaces:
AutoCloseable,IRunnableDeviceService,IConnection,IPositionerService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePositioner(String name) This method sets the value of the scannables named to this position.createPositioner(INameable parent) This method sets the value of the scannables named to this position.voidCall to disconnect any resources which we no longer need.Deprecated, for removal: This API element is subject to removal in a future version.Get the information for all the runnable devices currently created.getDeviceInformation(String name) Get the information for the named runnable device.Get the information for all the runnable devices currently created with a specific role.Get the information for all the runnable devices currently created.protected IEventService<T> IRunnableDevice<T> getRunnableDevice(String name) Get a runnable device by name.<T> IRunnableDevice<T> getRunnableDevice(String name, IPublisher<ScanBean> publisher) Get a runnable device by name.A collection of the current named runnable devices which may be retrieved and configured.getUri()voidinit()booleanReturns whether this connection is connected.<T> voidregister(IRunnableDevice<T> device) Used to register a device.voidsetConnected(boolean isConnected) voidsetEventService(IEventService eservice) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.event.core.IConnection
closeMethods inherited from interface org.eclipse.scanning.api.device.IRunnableDeviceService
getActiveScanner
-
Field Details
-
eservice
-
uri
-
-
Constructor Details
-
RunnableDeviceServiceProxy
public RunnableDeviceServiceProxy()
-
-
Method Details
-
init
- Throws:
EventException
-
disconnect
Description copied from interface:IConnectionCall to disconnect any resources which we no longer need. The resource may have timed out so it might not be connected, in that case it silently returns. Note, that the methodIConnection.close(), inherited fromAutoCloseablecalls this method, which means that if an object of a class implementingIConnectionis used with a try-with-resources block this method will be called automatically when exiting that block.- Specified by:
disconnectin interfaceIConnection- Throws:
EventException- if resource could not be disconnected.
-
createPositioner
Description copied from interface:IPositionerServiceThis method sets the value of the scannables named to this position. It takes into account the levels of the scannbles. It is blocking until all the scannables have reached the desired location.- Specified by:
createPositionerin interfaceIPositionerService- Parameters:
parent- the parent device- Returns:
- the positioner
- Throws:
ScanningException
-
createPositioner
Description copied from interface:IPositionerServiceThis method sets the value of the scannables named to this position. It takes into account the levels of the scannbles. It is blocking until all the scannables have reached the desired location.- Specified by:
createPositionerin interfaceIPositionerService- Parameters:
name- the name of the positioner- Returns:
- the positioner
- Throws:
ScanningException
-
getRunnableDevice
Description copied from interface:IRunnableDeviceServiceGet a runnable device by name. If the device was created by spring it may need configuring before use. If the device was added to the service after a createRunnableDevice(...) call, it will already be configured.- Specified by:
getRunnableDevicein interfaceIRunnableDeviceService- Parameters:
name-- Returns:
- named runnable device
- Throws:
ScanningException
-
getRunnableDevice
public <T> IRunnableDevice<T> getRunnableDevice(String name, IPublisher<ScanBean> publisher) throws ScanningException Description copied from interface:IRunnableDeviceServiceGet a runnable device by name. If the device was created by spring it may need configuring before use. If the device was added to the service after a createRunnableDevice(...) call, it will already be configured.- Specified by:
getRunnableDevicein interfaceIRunnableDeviceService- Parameters:
name-publisher- used for a particular run of the device. This must be set with care as only one publisher may be active on a device at a time.- Returns:
- named runnable device
- Throws:
ScanningException
-
getRunnableDeviceNames
Description copied from interface:IRunnableDeviceServiceA collection of the current named runnable devices which may be retrieved and configured.- Specified by:
getRunnableDeviceNamesin interfaceIRunnableDeviceService- Returns:
- devices
- Throws:
ScanningException
-
getDeviceConnectorService
@Deprecated(since="GDA 9.33", forRemoval=true) public IScannableDeviceService getDeviceConnectorService()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IRunnableDeviceServiceGet the service being used to connect this service to the underlying hardware devices.- Specified by:
getDeviceConnectorServicein interfaceIRunnableDeviceService- Returns:
- connection service
-
getDeviceInformationIncludingNonAlive
public Collection<DeviceInformation<?>> getDeviceInformationIncludingNonAlive() throws ScanningExceptionDescription copied from interface:IRunnableDeviceServiceGet the information for all the runnable devices currently created. Will attempt to get device information that is potentially held on the device even if the device is not alive.- Specified by:
getDeviceInformationIncludingNonAlivein interfaceIRunnableDeviceService- Returns:
- information for all the runnable devices currently created
- Throws:
ScanningException
-
getDeviceInformation
Description copied from interface:IRunnableDeviceServiceGet the information for all the runnable devices currently created. Will not get device information that is potentially held on the device if the device is not alive.- Specified by:
getDeviceInformationin interfaceIRunnableDeviceService- Returns:
- information for all the runnable devices currently created
- Throws:
ScanningException
-
getDeviceInformation
public Collection<DeviceInformation<?>> getDeviceInformation(DeviceRole role) throws ScanningException Description copied from interface:IRunnableDeviceServiceGet the information for all the runnable devices currently created with a specific role. Will not get device information that is potentially held on the device if the device is not alive.- Specified by:
getDeviceInformationin interfaceIRunnableDeviceService- Returns:
- device info
- Throws:
ScanningException
-
getDeviceInformation
Description copied from interface:IRunnableDeviceServiceGet the information for the named runnable device.- Specified by:
getDeviceInformationin interfaceIRunnableDeviceService- Returns:
- information for the named device
- Throws:
ScanningException
-
register
Description copied from interface:IRunnableDeviceServiceUsed to register a device. This is required so that spring may create detectors and call the register method by telling the detector to register itself.- Specified by:
registerin interfaceIRunnableDeviceService- Parameters:
device-
-
getEventService
-
setEventService
-
getUri
-
setUri
-
isConnected
public boolean isConnected()Description copied from interface:IConnectionReturns whether this connection is connected. This method returnstrueuntil disconnect is called, even if the connection is created lazily.- Specified by:
isConnectedin interfaceIConnection- Returns:
trueif connected,falseotherwise
-
setConnected
public void setConnected(boolean isConnected)
-