ome.system
Class ServiceFactory

java.lang.Object
  extended by ome.system.ServiceFactory
Direct Known Subclasses:
InternalServiceFactory, ManagedServiceFactory

public class ServiceFactory
extends Object

Entry point for all client calls. Provides methods to obtain proxies for all remote facades.

Since:
3.0
Author:
Josh Moore, josh.moore at gmx.de
See Also:
OmeroContext

Field Summary
protected  OmeroContext ctx
          the context instance which this ServiceFactory uses to look up all of its state.
 
Constructor Summary
ServiceFactory()
          default constructor which obtains the global static client context from OmeroContext.
ServiceFactory(Login login)
          constructor which obtains a new (non-static) client context, passing in the Properties representation of the Login for configuration.
ServiceFactory(OmeroContext context)
          constructor which uses the provided OmeroContext for all loookups.
ServiceFactory(Properties properties)
          constructor which obtains a new client context, passing in the provided properties for configuration.
ServiceFactory(Server server)
          constructor which obtains a new (non-static) client context, passing in the Properties representation of the Server for configuration.
ServiceFactory(Server server, Login login)
          constructor which obtains a new (non-static) client context, passing in the Properties representation of both the Server and the Login for configuration.
ServiceFactory(String contextName)
          constructor which finds the global static OmeroContext with the given name.
 
Method Summary
 void closeSession()
           
 JobHandle createJobHandle()
          create a new JobHandle proxy.
 RawFileStore createRawFileStore()
          create a new RawFileStore proxy.
 RawPixelsStore createRawPixelsStore()
          create a new RawPixelsStore proxy.
 RenderingEngine createRenderingEngine()
          create a new RenderingEngine proxy.
 Search createSearchService()
          create a new Search proxy.
 ThumbnailStore createThumbnailService()
          create a new ThumbnailStore proxy.
 IAdmin getAdminService()
           
 IAnalysis getAnalysisService()
           
 IConfig getConfigService()
           
 IContainer getContainerService()
           
 OmeroContext getContext()
          Deprecated.  
protected  String getDefaultContext()
          used when no context name is provided to the constructor.
 IDelete getDeleteService()
           
 ILdap getLdapService()
           
 IMetadata getMetadataService()
           
 IPixels getPixelsService()
           
protected  String getPrefix()
          used by getServiceByClass(Class) to find the correct service proxy in the ctx
 IProjection getProjectionService()
           
 IQuery getQueryService()
           
 IRenderingSettings getRenderingSettingsService()
           
 IRepositoryInfo getRepositoryInfoService()
           
<T extends ServiceInterface>
T
getServiceByClass(Class<T> klass)
          looks up services based on the current prefix and the class name of the service type.
 ome.model.meta.Session getSession()
           
protected  SessionInitializer getSessionInitializer()
           
 ISession getSessionService()
           
 IShare getShareService()
           
 ITypes getTypesService()
           
 IUpdate getUpdateService()
           
 void setSession(ome.model.meta.Session session)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctx

protected OmeroContext ctx
the context instance which this ServiceFactory uses to look up all of its state.

Constructor Detail

ServiceFactory

public ServiceFactory()
default constructor which obtains the global static client context from OmeroContext. This can be done manually by calling OmeroContext.getClientContext()

See Also:
OmeroContext.CLIENT_CONTEXT, OmeroContext.getClientContext()

ServiceFactory

public ServiceFactory(Login login)
constructor which obtains a new (non-static) client context, passing in the Properties representation of the Login for configuration.

See Also:
Login.asProperties(), ServiceFactory(Properties)

ServiceFactory

public ServiceFactory(Server server)
constructor which obtains a new (non-static) client context, passing in the Properties representation of the Server for configuration.

See Also:
Server.asProperties(), ServiceFactory(Properties)

ServiceFactory

public ServiceFactory(Server server,
                      Login login)
constructor which obtains a new (non-static) client context, passing in the Properties representation of both the Server and the Login for configuration.

See Also:
Login.asProperties(), ServiceFactory(Properties)

ServiceFactory

public ServiceFactory(Properties properties)
constructor which obtains a new client context, passing in the provided properties for configuration.

See Also:
OmeroContext.getClientContext(Properties)

ServiceFactory

public ServiceFactory(OmeroContext context)
constructor which uses the provided OmeroContext for all loookups.


ServiceFactory

public ServiceFactory(String contextName)
constructor which finds the global static OmeroContext with the given name.

See Also:
OmeroContext.CLIENT_CONTEXT, OmeroContext#INTERNAL_CONTEXT, OmeroContext.MANAGED_CONTEXT
Method Detail

getContext

@Deprecated
public OmeroContext getContext()
Deprecated. 

public access to the context. This may not always be available, but for this initial phase, it makes some sense. Completely non-dangerous on the client-side.


getAdminService

public IAdmin getAdminService()

getAnalysisService

public IAnalysis getAnalysisService()

getConfigService

public IConfig getConfigService()

getContainerService

public IContainer getContainerService()

getDeleteService

public IDelete getDeleteService()

getLdapService

public ILdap getLdapService()

getPixelsService

public IPixels getPixelsService()

getProjectionService

public IProjection getProjectionService()

getQueryService

public IQuery getQueryService()

getShareService

public IShare getShareService()

getTypesService

public ITypes getTypesService()

getUpdateService

public IUpdate getUpdateService()

getRenderingSettingsService

public IRenderingSettings getRenderingSettingsService()

getRepositoryInfoService

public IRepositoryInfo getRepositoryInfoService()

getMetadataService

public IMetadata getMetadataService()

createJobHandle

public JobHandle createJobHandle()
create a new JobHandle proxy. This proxy will have to be initialized using JobHandle.attach(long) or JobHandle.submit(ome.model.jobs.Job).


createRawPixelsStore

public RawPixelsStore createRawPixelsStore()
create a new RawPixelsStore proxy. This proxy will have to be initialized using RawPixelsStore#setPixelsId(long)


createRawFileStore

public RawFileStore createRawFileStore()
create a new RawFileStore proxy. This proxy will have to be initialized using RawFileStore.setFileId(long)


createRenderingEngine

public RenderingEngine createRenderingEngine()
create a new RenderingEngine proxy. This proxy will have to be initialized using RenderingEngine.lookupPixels(long) and RenderingEngine.load()


createSearchService

public Search createSearchService()
create a new Search proxy.


createThumbnailService

public ThumbnailStore createThumbnailService()
create a new ThumbnailStore proxy. This proxy will have to be initialized using ThumbnailStore.setPixelsId(long)


getSessionService

public ISession getSessionService()

getSession

public ome.model.meta.Session getSession()
                                  throws ome.conditions.ApiUsageException
Throws:
ome.conditions.ApiUsageException

setSession

public void setSession(ome.model.meta.Session session)
                throws ome.conditions.ApiUsageException
Throws:
ome.conditions.ApiUsageException

closeSession

public void closeSession()
                  throws ome.conditions.ApiUsageException
Throws:
ome.conditions.ApiUsageException

getSessionInitializer

protected SessionInitializer getSessionInitializer()

getServiceByClass

public <T extends ServiceInterface> T getServiceByClass(Class<T> klass)
looks up services based on the current prefix and the class name of the service type.


getPrefix

protected String getPrefix()
used by getServiceByClass(Class) to find the correct service proxy in the ctx

Returns:
a String, usually "internal-" or "managed-"

getDefaultContext

protected String getDefaultContext()
used when no context name is provided to the constructor. Subclasses can override to allow for easier creation.

Returns:
name of default context as found in beanRefContext.xml.


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

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