ome.services.blitz.impl
Class ServiceFactoryI

java.lang.Object
  extended by Ice.ObjectImpl
      extended by omero.api._ServiceFactoryDisp
          extended by ome.services.blitz.impl.ServiceFactoryI
All Implemented Interfaces:
Glacier2._SessionOperations, Glacier2._SessionOperationsNC, Glacier2.Session, Ice.Object, Serializable, Cloneable, omero.api._ServiceFactoryOperations, omero.api._ServiceFactoryOperationsNC, omero.api.ServiceFactory

public final class ServiceFactoryI
extends omero.api._ServiceFactoryDisp

Responsible for maintaining all servants for a single session. In general, try to reduce access to the Current and Util objects.

Since:
3.0-Beta2
Author:
Josh Moore, josh at glencoesoftware.com
See Also:
Serialized Form

Field Summary
 String clientId
           
 Glacier2.SessionControlPrx control
           
 
Fields inherited from class omero.api._ServiceFactoryDisp
__ids
 
Constructor Summary
ServiceFactoryI(Ice.Current current, Glacier2.SessionControlPrx control, OmeroContext context, SessionManager manager, Executor executor, Principal p, List<HardWiredInterceptor> interceptors, TopicManager topicManager, Registry registry)
           
 
Method Summary
 List<String> activeServices(Ice.Current __current)
           
static String clientId(Ice.Current current)
          Helpers method to extract the CLIENTUUID out of the given Ice.Current.
 void close(Ice.Current current)
          Deprecated. 
 void closeOnDestroy(Ice.Current current)
           
 omero.api.StatefulServiceInterfacePrx createByName(String name, Ice.Current current)
           
 omero.api.ExporterPrx createExporter(Ice.Current current)
           
 omero.api.GatewayPrx createGateway(Ice.Current current)
           
 omero.api.JobHandlePrx createJobHandle(Ice.Current current)
           
 omero.api.RawFileStorePrx createRawFileStore(Ice.Current current)
           
 omero.api.RawPixelsStorePrx createRawPixelsStore(Ice.Current current)
           
 omero.api.RenderingEnginePrx createRenderingEngine(Ice.Current current)
           
 omero.api.SearchPrx createSearchService(Ice.Current current)
           
protected  Ice.Object createServantDelegate(String name)
          Creates a proxy according to the ServantDefinition for the given name.
 omero.api.ThumbnailStorePrx createThumbnailStore(Ice.Current current)
           
 void destroy(Ice.Current current)
          Destruction simply decrements the reference count for a session to allow reconnecting to it.
 void detachOnDestroy(Ice.Current current)
           
 void doDestroy()
          Performs the actual cleanup operation on all the resources shared between this and other ServiceFactoryI instances in the same Session.
 Ice.ObjectAdapter getAdapter()
           
 omero.api.IAdminPrx getAdminService(Ice.Current current)
           
 omero.api.ServiceInterfacePrx getByName(String name, Ice.Current current)
           
 omero.api.IConfigPrx getConfigService(Ice.Current current)
           
 omero.api.IContainerPrx getContainerService(Ice.Current current)
           
 omero.api.IDeletePrx getDeleteService(Ice.Current current)
           
 Executor getExecutor()
           
protected  Ice.Identity getIdentity(String key)
          Constructs an Identity from the name of this ServiceFactoryI and from the given String which for stateless services are defined by the instance fields #adminKey, #configKey, etc. and for stateful services are UUIDs.
 omero.api.ILdapPrx getLdapService(Ice.Current current)
           
 omero.api.IMetadataPrx getMetadataService(Ice.Current current)
           
 omero.api.IPixelsPrx getPixelsService(Ice.Current current)
           
 Principal getPrincipal()
           
 omero.api.IProjectionPrx getProjectionService(Ice.Current current)
           
 omero.api.IQueryPrx getQueryService(Ice.Current current)
           
 omero.api.IRenderingSettingsPrx getRenderingSettingsService(Ice.Current current)
           
 omero.api.IRepositoryInfoPrx getRepositoryInfoService(Ice.Current current)
           
 omero.api.IRoiPrx getRoiService(Ice.Current current)
           
 omero.api.IScriptPrx getScriptService(Ice.Current current)
           
 omero.api.ISessionPrx getSessionService(Ice.Current current)
           
 omero.api.ISharePrx getShareService(Ice.Current current)
           
 omero.api.ITimelinePrx getTimelineService(Ice.Current current)
           
 omero.api.ITypesPrx getTypesService(Ice.Current current)
           
 omero.api.IUpdatePrx getUpdateService(Ice.Current current)
           
 boolean keepAlive(omero.api.ServiceInterfacePrx proxy, Ice.Current __current)
          Currently ignoring the individual proxies
 long keepAllAlive(omero.api.ServiceInterfacePrx[] proxies, Ice.Current __current)
           
protected  Ice.ObjectPrx registerServant(Ice.Current current, Ice.Identity id, Ice.Object servant)
          Registers the servant with the adapter (or throws an exception if one is already registered) as well as configures the servant in any post-Spring way necessary, based on the type of the servant.
 Ice.Identity sessionId()
          Returns the Identity for this instance as defined by sessionId(String, String)
static Ice.Identity sessionId(String clientId, String uuid)
          Definition of session ids: "session-/"
 void setCallback(omero.api.ClientCallbackPrx callback, Ice.Current current)
           
 omero.grid.SharedResourcesPrx sharedResources(Ice.Current current)
           
 void subscribe(String topicName, Ice.ObjectPrx prx, Ice.Current __current)
           
 void unregisterServant(Ice.Identity id)
          Reverts all the additions made by #registerServant(ServantInterface, Ice.Current, Ice.Identity) Now called by SessionManagerI in response to an UnregisterServantMessage
 
Methods inherited from class omero.api._ServiceFactoryDisp
___activeServices, ___close, ___closeOnDestroy, ___createByName, ___createExporter, ___createGateway, ___createJobHandle, ___createRawFileStore, ___createRawPixelsStore, ___createRenderingEngine, ___createSearchService, ___createThumbnailStore, ___detachOnDestroy, ___getAdminService, ___getByName, ___getConfigService, ___getContainerService, ___getDeleteService, ___getLdapService, ___getMetadataService, ___getPixelsService, ___getProjectionService, ___getQueryService, ___getRenderingSettingsService, ___getRepositoryInfoService, ___getRoiService, ___getScriptService, ___getSessionService, ___getShareService, ___getTimelineService, ___getTypesService, ___getUpdateService, ___keepAlive, ___keepAllAlive, ___setCallback, ___sharedResources, ___subscribe, __dispatch, __read, __read, __write, __write, activeServices, close, closeOnDestroy, createByName, createExporter, createGateway, createJobHandle, createRawFileStore, createRawPixelsStore, createRenderingEngine, createSearchService, createThumbnailStore, destroy, detachOnDestroy, getAdminService, getByName, getConfigService, getContainerService, getDeleteService, getLdapService, getMetadataService, getPixelsService, getProjectionService, getQueryService, getRenderingSettingsService, getRepositoryInfoService, getRoiService, getScriptService, getSessionService, getShareService, getTimelineService, getTypesService, getUpdateService, ice_copyStateFrom, ice_id, ice_id, ice_ids, ice_ids, ice_isA, ice_isA, ice_staticId, keepAlive, keepAllAlive, setCallback, sharedResources, subscribe
 
Methods inherited from class Ice.ObjectImpl
___ice_id, ___ice_ids, ___ice_isA, ___ice_ping, __checkMode, __collocDispatch, clone, ice_dispatch, ice_hash, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Ice.Object
__collocDispatch, clone, equals, ice_dispatch, ice_hash, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
 

Field Detail

clientId

public final String clientId

control

public final Glacier2.SessionControlPrx control
Constructor Detail

ServiceFactoryI

public ServiceFactoryI(Ice.Current current,
                       Glacier2.SessionControlPrx control,
                       OmeroContext context,
                       SessionManager manager,
                       Executor executor,
                       Principal p,
                       List<HardWiredInterceptor> interceptors,
                       TopicManager topicManager,
                       Registry registry)
                throws omero.ApiUsageException
Throws:
omero.ApiUsageException
Method Detail

getAdapter

public Ice.ObjectAdapter getAdapter()

getPrincipal

public Principal getPrincipal()

getExecutor

public Executor getExecutor()

getAdminService

public omero.api.IAdminPrx getAdminService(Ice.Current current)
                                    throws omero.ServerError
Throws:
omero.ServerError

getConfigService

public omero.api.IConfigPrx getConfigService(Ice.Current current)
                                      throws omero.ServerError
Throws:
omero.ServerError

getDeleteService

public omero.api.IDeletePrx getDeleteService(Ice.Current current)
                                      throws omero.ServerError
Throws:
omero.ServerError

getLdapService

public omero.api.ILdapPrx getLdapService(Ice.Current current)
                                  throws omero.ServerError
Throws:
omero.ServerError

getPixelsService

public omero.api.IPixelsPrx getPixelsService(Ice.Current current)
                                      throws omero.ServerError
Throws:
omero.ServerError

getContainerService

public omero.api.IContainerPrx getContainerService(Ice.Current current)
                                            throws omero.ServerError
Throws:
omero.ServerError

getProjectionService

public omero.api.IProjectionPrx getProjectionService(Ice.Current current)
                                              throws omero.ServerError
Throws:
omero.ServerError

getQueryService

public omero.api.IQueryPrx getQueryService(Ice.Current current)
                                    throws omero.ServerError
Throws:
omero.ServerError

getRoiService

public omero.api.IRoiPrx getRoiService(Ice.Current current)
                                throws omero.ServerError
Throws:
omero.ServerError

getScriptService

public omero.api.IScriptPrx getScriptService(Ice.Current current)
                                      throws omero.ServerError
Throws:
omero.ServerError

getSessionService

public omero.api.ISessionPrx getSessionService(Ice.Current current)
                                        throws omero.ServerError
Throws:
omero.ServerError

getShareService

public omero.api.ISharePrx getShareService(Ice.Current current)
                                    throws omero.ServerError
Throws:
omero.ServerError

getTimelineService

public omero.api.ITimelinePrx getTimelineService(Ice.Current current)
                                          throws omero.ServerError
Throws:
omero.ServerError

getTypesService

public omero.api.ITypesPrx getTypesService(Ice.Current current)
                                    throws omero.ServerError
Throws:
omero.ServerError

getUpdateService

public omero.api.IUpdatePrx getUpdateService(Ice.Current current)
                                      throws omero.ServerError
Throws:
omero.ServerError

getRenderingSettingsService

public omero.api.IRenderingSettingsPrx getRenderingSettingsService(Ice.Current current)
                                                            throws omero.ServerError
Throws:
omero.ServerError

getRepositoryInfoService

public omero.api.IRepositoryInfoPrx getRepositoryInfoService(Ice.Current current)
                                                      throws omero.ServerError
Throws:
omero.ServerError

getMetadataService

public omero.api.IMetadataPrx getMetadataService(Ice.Current current)
                                          throws omero.ServerError
Throws:
omero.ServerError

createExporter

public omero.api.ExporterPrx createExporter(Ice.Current current)
                                     throws omero.ServerError
Throws:
omero.ServerError

createGateway

public omero.api.GatewayPrx createGateway(Ice.Current current)
                                   throws omero.ServerError
Throws:
omero.ServerError

createJobHandle

public omero.api.JobHandlePrx createJobHandle(Ice.Current current)
                                       throws omero.ServerError
Throws:
omero.ServerError

createRenderingEngine

public omero.api.RenderingEnginePrx createRenderingEngine(Ice.Current current)
                                                   throws omero.ServerError
Throws:
omero.ServerError

createRawFileStore

public omero.api.RawFileStorePrx createRawFileStore(Ice.Current current)
                                             throws omero.ServerError
Throws:
omero.ServerError

createRawPixelsStore

public omero.api.RawPixelsStorePrx createRawPixelsStore(Ice.Current current)
                                                 throws omero.ServerError
Throws:
omero.ServerError

createSearchService

public omero.api.SearchPrx createSearchService(Ice.Current current)
                                        throws omero.ServerError
Throws:
omero.ServerError

createThumbnailStore

public omero.api.ThumbnailStorePrx createThumbnailStore(Ice.Current current)
                                                 throws omero.ServerError
Throws:
omero.ServerError

sharedResources

public omero.grid.SharedResourcesPrx sharedResources(Ice.Current current)
                                              throws omero.ServerError
Throws:
omero.ServerError

getByName

public omero.api.ServiceInterfacePrx getByName(String name,
                                               Ice.Current current)
                                        throws omero.ServerError
Throws:
omero.ServerError

createByName

public omero.api.StatefulServiceInterfacePrx createByName(String name,
                                                          Ice.Current current)
                                                   throws omero.ServerError
Throws:
omero.ServerError

subscribe

public void subscribe(String topicName,
                      Ice.ObjectPrx prx,
                      Ice.Current __current)
               throws omero.ServerError
Throws:
omero.ServerError

setCallback

public void setCallback(omero.api.ClientCallbackPrx callback,
                        Ice.Current current)

detachOnDestroy

public void detachOnDestroy(Ice.Current current)

close

@Deprecated
public void close(Ice.Current current)
Deprecated. 


closeOnDestroy

public void closeOnDestroy(Ice.Current current)

destroy

public void destroy(Ice.Current current)
Destruction simply decrements the reference count for a session to allow reconnecting to it. This means that the Glacier timeout property is fairly unimportant. If a Glacier connection times out or is otherwise destroyed, a client can attempt to reconnect. However, in the case of only one reference to the session, if the Glacier2 timeout is greater than the session timeout, exceptions can be thrown when this method tries to clean up the session. Therefore all session access must be guarded by a try/finally block.


doDestroy

public void doDestroy()
Performs the actual cleanup operation on all the resources shared between this and other ServiceFactoryI instances in the same Session. Since _ServiceFactoryDisp.destroy() is called regardless by the router, even when a client has just died, we have this internal method for handling the actual closing of resources. This method must take precautions to not throw a SessionException . See destroy(Current) for more information.


activeServices

public List<String> activeServices(Ice.Current __current)

keepAllAlive

public long keepAllAlive(omero.api.ServiceInterfacePrx[] proxies,
                         Ice.Current __current)

keepAlive

public boolean keepAlive(omero.api.ServiceInterfacePrx proxy,
                         Ice.Current __current)
Currently ignoring the individual proxies


getIdentity

protected Ice.Identity getIdentity(String key)
Constructs an Identity from the name of this ServiceFactoryI and from the given String which for stateless services are defined by the instance fields #adminKey, #configKey, etc. and for stateful services are UUIDs.


createServantDelegate

protected Ice.Object createServantDelegate(String name)
                                    throws omero.ServerError
Creates a proxy according to the ServantDefinition for the given name. Injects the #helper instance for this session so that all services are linked to a single session. Creates an ome.api.* service (mostly managed by Spring), wraps it with the interceptors which are in effect, and stores the instance away in the cache. Note: Since HardWiredInterceptor implements MethodInterceptor, all the Advice instances will be wrapped in Advisor instances and will be returned by Advised.getAdvisors().

Throws:
omero.ServerError

registerServant

protected Ice.ObjectPrx registerServant(Ice.Current current,
                                        Ice.Identity id,
                                        Ice.Object servant)
                                 throws omero.ServerError
Registers the servant with the adapter (or throws an exception if one is already registered) as well as configures the servant in any post-Spring way necessary, based on the type of the servant.

Throws:
omero.ServerError

unregisterServant

public void unregisterServant(Ice.Identity id)
Reverts all the additions made by #registerServant(ServantInterface, Ice.Current, Ice.Identity) Now called by SessionManagerI in response to an UnregisterServantMessage


sessionId

public static Ice.Identity sessionId(String clientId,
                                     String uuid)
Definition of session ids: "session-/"


sessionId

public Ice.Identity sessionId()
Returns the Identity for this instance as defined by sessionId(String, String)

Returns:

clientId

public static String clientId(Ice.Current current)
                       throws omero.ApiUsageException
Helpers method to extract the CLIENTUUID out of the given Ice.Current. Throws an ApiUsageException if none is present, since it is each client's responsibility to set this value. (Typically done in our SDKs)

Throws:
omero.ApiUsageException


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.