ome.services.blitz.impl
Class AbstractAmdServant

java.lang.Object
  extended by ome.services.blitz.impl.AbstractAmdServant
All Implemented Interfaces:
CloseableServant, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
AdminI, ConfigI, ContainerI, DeleteI, ExporterI, JobHandleI, LdapI, MetadataI, MetadataStoreI, OmeroGateway, PixelsI, ProjectionI, QueryI, RawFileStoreI, RawPixelsStoreI, RenderingEngineI, RenderingSettingsI, RepositoryInfoI, RoiI, ScriptI, SearchI, SessionI, SharedResourcesI, ShareI, ThumbnailStoreI, TimelineI, TypesI, UpdateI

public abstract class AbstractAmdServant
extends Object
implements org.springframework.context.ApplicationContextAware, CloseableServant

throttled implementation base class which can be used by _ServiceInterfaceOperations implementors and injected into a tie servant.

Since:
3.0-Beta4
Author:
Josh Moore, josh at glencoesoftware.com

Field Summary
protected  BlitzExecutor be
           
protected  OmeroContext ctx
           
protected  IceMethodInvoker invoker
          If a service is provided, then an invoker will be created to cache all of its methods.
protected  org.apache.commons.logging.Log log
           
protected  ServiceInterface service
          If there is no undering ome.* service, then this value can be null.
 
Constructor Summary
AbstractAmdServant(ServiceInterface service, BlitzExecutor be)
           
 
Method Summary
 void activate_async(omero.api.AMD_StatefulServiceInterface_activate __cb, Ice.Current __current)
           
 void applyHardWiredInterceptors(List<HardWiredInterceptor> cptors, AopContextInitializer initializer)
          Applies the hard-wired intercepting to this instance.
 void callInvokerOnMappedArgs(IceMapper mapper, Object __cb, Ice.Current __current, Object... args)
           
 void callInvokerOnRawArgs(Object __cb, Ice.Current __current, Object... args)
           
 void close_async(omero.api.AMD_StatefulServiceInterface_close __cb, Ice.Current __current)
          SessionHandler also specially catches close() calls, but cannot remove the servant from the ObjectAdapter and thereby prevent any further communication.
 void close(Ice.Current __current)
           
 void executorWorkCall(Executor.Work work)
           
 void getCurrentEventContext_async(omero.api.AMD_StatefulServiceInterface_getCurrentEventContext __cb, Ice.Current __current)
           
 void onSetOmeroContext(OmeroContext context)
          To be overridden by subclasses.
 void passivate_async(omero.api.AMD_StatefulServiceInterface_passivate __cb, Ice.Current __current)
           
protected  void preClose()
           
 void runnableCall(Ice.Current __current, Task r)
           
<R> void
safeRunnableCall(Ice.Current __current, Object cb, boolean isVoid, Callable<R> callable)
           
 void setApplicationContext(org.springframework.context.ApplicationContext ctx)
          Creates an IceMethodInvoker for this instance if service is non-null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log

be

protected final BlitzExecutor be

service

protected ServiceInterface service
If there is no undering ome.* service, then this value can be null.


invoker

protected IceMethodInvoker invoker
If a service is provided, then an invoker will be created to cache all of its methods.


ctx

protected OmeroContext ctx
Constructor Detail

AbstractAmdServant

public AbstractAmdServant(ServiceInterface service,
                          BlitzExecutor be)
Method Detail

setApplicationContext

public final void setApplicationContext(org.springframework.context.ApplicationContext ctx)
                                 throws org.springframework.beans.BeansException
Creates an IceMethodInvoker for this instance if service is non-null. Otherwise gives subclasses a chance to use the OmeroContext via #onSetContext(OmeroContext)

Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

onSetOmeroContext

public void onSetOmeroContext(OmeroContext context)
                       throws Exception
To be overridden by subclasses.

Throws:
Exception

applyHardWiredInterceptors

public final void applyHardWiredInterceptors(List<HardWiredInterceptor> cptors,
                                             AopContextInitializer initializer)
Applies the hard-wired intercepting to this instance. It is not possible to configure hard-wired interceptors in Spring, instead they must be passed in at runtime from a properly compiled class.


callInvokerOnRawArgs

public final void callInvokerOnRawArgs(Object __cb,
                                       Ice.Current __current,
                                       Object... args)

callInvokerOnMappedArgs

public final void callInvokerOnMappedArgs(IceMapper mapper,
                                          Object __cb,
                                          Ice.Current __current,
                                          Object... args)

runnableCall

public final void runnableCall(Ice.Current __current,
                               Task r)

safeRunnableCall

public final <R> void safeRunnableCall(Ice.Current __current,
                                       Object cb,
                                       boolean isVoid,
                                       Callable<R> callable)

executorWorkCall

public final void executorWorkCall(Executor.Work work)

activate_async

public final void activate_async(omero.api.AMD_StatefulServiceInterface_activate __cb,
                                 Ice.Current __current)

passivate_async

public final void passivate_async(omero.api.AMD_StatefulServiceInterface_passivate __cb,
                                  Ice.Current __current)

getCurrentEventContext_async

public final void getCurrentEventContext_async(omero.api.AMD_StatefulServiceInterface_getCurrentEventContext __cb,
                                               Ice.Current __current)
                                        throws omero.ServerError
Throws:
omero.ServerError

close

public final void close(Ice.Current __current)
Specified by:
close in interface CloseableServant

close_async

public final void close_async(omero.api.AMD_StatefulServiceInterface_close __cb,
                              Ice.Current __current)
SessionHandler also specially catches close() calls, but cannot remove the servant from the ObjectAdapter and thereby prevent any further communication. Once the invocation is finished, though, it is possible to raise the message and have the servant cleaned up.

See Also:
ticket:1855

preClose

protected void preClose()


OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

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