public class IceMethodInvoker extends Object
Method
-cache primed either with an ServiceInterface
instance
or with a Class
with generic type ServiceInterface
. Actual
invocation happens via
invoke(Object, Ice.Current, IceMapper, Object[])
No reference is held to the initial priming argument in
IceMethodInvoker(ServiceInterface, OmeroContext)
just the class.
MAPPING RULES:
Constructor and Description |
---|
IceMethodInvoker(Class<S> k,
OmeroContext context)
Creates an
IceMethodInvoker instance by using reflection on the
Class argument. |
IceMethodInvoker(ServiceInterface srv,
OmeroContext context)
Create an
IceMethodInvoker instance using the Class of
the passed argument to call
IceMethodInvoker#IceMethodInvoker(Class) . |
Modifier and Type | Method and Description |
---|---|
Method |
getMethod(String name)
For testing the cached method.
|
Object |
invoke(Object obj,
Ice.Current current,
IceMapper mapper,
Object... args)
Calls the method named in
Current.operation with the
arguments provided mapped via the IceMapper instance. |
boolean |
isVoid(Ice.Current current)
Checks for a void return type, which is needed to know what type of
ice_response() method to invoke.
|
public IceMethodInvoker(ServiceInterface srv, OmeroContext context)
IceMethodInvoker
instance using the Class
of
the passed argument to call
IceMethodInvoker#IceMethodInvoker(Class)
.srv
- A Non-null ServiceInterface
instance.context
- The active OmeroContext
instance.public IceMethodInvoker(Class<S> k, OmeroContext context)
IceMethodInvoker
instance by using reflection on the
Class
argument. All information is cached internally in a static
map
if the given service class argument has not
already been cached.S
- A type which subclasses ServiceInterface
c
- A non-null ServiceInterface
Class
public boolean isVoid(Ice.Current current)
public Object invoke(Object obj, Ice.Current current, IceMapper mapper, Object... args) throws Ice.UserException
Current.operation
with the
arguments provided mapped via the IceMapper
instance. The return
value or any method which is thrown is equally mapped and returned.
Clients of this method must check the return value for exceptions.
ServantHelper#throwIfNecessary(Object)
does just this, but is
also called internally by ServantHelper#checkVoid(Object)
and
ServantHelper#returnValue(Class, Object)
.obj
- Instance for the call to
Method.invoke(Object, Object[])
. Can be null if this
is a static call.current
- The current Ice operation. Non-null.mapper
- A non-null mapper.args
- The proper number of arguments for the method specified in
current.Ice.UserException
Version: 5.1.4-ice35-b55
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.