Package ome.services.blitz.impl
Class SharedResourcesI
- java.lang.Object
-
- ome.services.blitz.impl.AbstractAmdServant
-
- ome.services.blitz.impl.AbstractCloseableAmdServant
-
- ome.services.blitz.impl.SharedResourcesI
-
- All Implemented Interfaces:
BlitzOnly,ServiceFactoryAware,_SharedResourcesOperations,ParamsHelper.Acquirer,CloseableServant,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class SharedResourcesI extends AbstractCloseableAmdServant implements _SharedResourcesOperations, BlitzOnly, ServiceFactoryAware, ParamsHelper.Acquirer
Implementation of the SharedResources interface.- Since:
- Beta4.1
- See Also:
SharedResources
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_TIMEOUTIf no value is passed to this instance, this is the time (1 hour) which will be used for a script session.
-
Constructor Summary
Constructors Constructor Description SharedResourcesI(BlitzExecutor be, TopicManager topicManager, Registry registry, ome.services.scripts.ScriptRepoHelper helper, ParamsCache cache)SharedResourcesI(BlitzExecutor be, TopicManager topicManager, Registry registry, ome.services.scripts.ScriptRepoHelper helper, ParamsCache cache, long waitMillis)SharedResourcesI(BlitzExecutor be, TopicManager topicManager, Registry registry, ome.services.scripts.ScriptRepoHelper helper, ParamsCache cache, long waitMillis, long timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InteractiveProcessorPrxacquireProcessor(Job submittedJob, int seconds, Ice.Current current)Waits up to seconds to acquire a slot in a processor which can handle the given job.voidaddProcessor(ProcessorPrx proc, Ice.Current __current)Registers aProcessorfor Storm notifications so that other sessions can query whether or not a given processor would accept a given task.booleanareTablesEnabled(Ice.Current __current)Returns true if aTablesservice is active in the grid.RepositoryPrxgetScriptRepository(Ice.Current __current)Returns the single (possibly mirrored) script repository which makes all official scripts available.TablePrxnewTable(long repo, java.lang.String path, Ice.Current __current)Creates a new Format(""OMERO.tables"") file at the given path on the given repository.TablePrxopenTable(OriginalFile file, Ice.Current __current)Returns a Table instance or null.protected voidpostClose(Ice.Current current)Should not throw any exceptions which should be detected by clients since it is called in a finally block after the client thread has been released.protected voidpreClose(Ice.Current current)voidremoveProcessor(ProcessorPrx proc, Ice.Current __current)Unregisters aProcessorfrom Storm notifications.RepositoryMaprepositories(Ice.Current current)Returns a map between Repository descriptions (omero::model::OriginalFile instances) and RepositoryPrx instances (possibly null).voidsetServiceFactory(ServiceFactoryI sf)-
Methods inherited from class ome.services.blitz.impl.AbstractCloseableAmdServant
close, close_async
-
Methods inherited from class ome.services.blitz.impl.AbstractAmdServant
activate_async, applyHardWiredInterceptors, callInvokerOnMappedArgs, callInvokerOnRawArgs, executorWorkCall, getCurrentEventContext_async, onSetOmeroContext, passivate_async, runnableCall, safeRunnableCall, setApplicationContext, setHolder
-
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final long DEFAULT_TIMEOUT
If no value is passed to this instance, this is the time (1 hour) which will be used for a script session.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SharedResourcesI
public SharedResourcesI(BlitzExecutor be, TopicManager topicManager, Registry registry, ome.services.scripts.ScriptRepoHelper helper, ParamsCache cache)
-
SharedResourcesI
public SharedResourcesI(BlitzExecutor be, TopicManager topicManager, Registry registry, ome.services.scripts.ScriptRepoHelper helper, ParamsCache cache, long waitMillis)
-
SharedResourcesI
public SharedResourcesI(BlitzExecutor be, TopicManager topicManager, Registry registry, ome.services.scripts.ScriptRepoHelper helper, ParamsCache cache, long waitMillis, long timeout)
-
-
Method Detail
-
setServiceFactory
public void setServiceFactory(ServiceFactoryI sf) throws ServerError
- Specified by:
setServiceFactoryin interfaceServiceFactoryAware- Throws:
ServerError
-
preClose
protected void preClose(Ice.Current current)
- Specified by:
preClosein classAbstractCloseableAmdServant
-
postClose
protected void postClose(Ice.Current current)
Description copied from class:AbstractCloseableAmdServantShould not throw any exceptions which should be detected by clients since it is called in a finally block after the client thread has been released.- Specified by:
postClosein classAbstractCloseableAmdServant
-
getScriptRepository
public RepositoryPrx getScriptRepository(Ice.Current __current) throws ServerError
Description copied from interface:_SharedResourcesOperationsReturns the single (possibly mirrored) script repository which makes all official scripts available.- Specified by:
getScriptRepositoryin interface_SharedResourcesOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
repositories
public RepositoryMap repositories(Ice.Current current) throws ServerError
Description copied from interface:_SharedResourcesOperationsReturns a map between Repository descriptions (omero::model::OriginalFile instances) and RepositoryPrx instances (possibly null).- Specified by:
repositoriesin interface_SharedResourcesOperations- Parameters:
current- The Current object for the invocation.- Throws:
ServerError
-
areTablesEnabled
public boolean areTablesEnabled(Ice.Current __current) throws ServerErrorDescription copied from interface:_SharedResourcesOperationsReturns true if aTablesservice is active in the grid. If this value is false, then all calls to#ewTableoropenTablewill either fail or return null (possibly blocking while waiting for a service to startup)- Specified by:
areTablesEnabledin interface_SharedResourcesOperations- Parameters:
__current- The Current object for the invocation.- Throws:
ServerError
-
newTable
public TablePrx newTable(long repo, java.lang.String path, Ice.Current __current) throws ServerError
Description copied from interface:_SharedResourcesOperationsCreates a new Format(""OMERO.tables"") file at the given path on the given repository. The returned Table proxy follows the same semantics as the openTable method.- Specified by:
newTablein interface_SharedResourcesOperations__current- The Current object for the invocation.- Throws:
ServerError
-
openTable
public TablePrx openTable(OriginalFile file, Ice.Current __current) throws ServerError
Description copied from interface:_SharedResourcesOperationsReturns a Table instance or null. Table instances are not exclusively owned by the client and may throw an OptimisticLockException if background modifications take place. The file instance must be managed (i.e. have a non-null id) and be of the format ""OMERO.tables"". Use newTable() to create a new instance.- Specified by:
openTablein interface_SharedResourcesOperations__current- The Current object for the invocation.- Throws:
ServerError
-
acquireProcessor
public InteractiveProcessorPrx acquireProcessor(Job submittedJob, int seconds, Ice.Current current) throws ServerError
Description copied from interface:_SharedResourcesOperationsWaits up to seconds to acquire a slot in a processor which can handle the given job.- Specified by:
acquireProcessorin interface_SharedResourcesOperations- Specified by:
acquireProcessorin interfaceParamsHelper.Acquirercurrent- The Current object for the invocation.- Throws:
ServerError
-
addProcessor
public void addProcessor(ProcessorPrx proc, Ice.Current __current) throws ServerError
Description copied from interface:_SharedResourcesOperationsRegisters aProcessorfor Storm notifications so that other sessions can query whether or not a given processor would accept a given task.- Specified by:
addProcessorin interface_SharedResourcesOperations__current- The Current object for the invocation.- Throws:
ServerError
-
removeProcessor
public void removeProcessor(ProcessorPrx proc, Ice.Current __current) throws ServerError
Description copied from interface:_SharedResourcesOperationsUnregisters aProcessorfrom Storm notifications. If the processor was not already registered viaaddProcessorthis is a no-op.- Specified by:
removeProcessorin interface_SharedResourcesOperations__current- The Current object for the invocation.- Throws:
ServerError
-
-