|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectelectric.service.object.ObjectService
ObjectService is an implementation of IService that supports per-application, per-session and per-request activation modes.
Constructor Summary | |
protected |
ObjectService()
Construct an uninitialized service. |
|
ObjectService(java.lang.Object object)
Construct an ObjectService that is associated with the specified object and whose activation mode is APPLICATION. |
|
ObjectService(java.lang.String className)
Construct an ObjectService that is associated with the specified class of object and whose activation mode is APPLICATION. |
Method Summary | |
protected void |
finalize()
|
java.lang.ClassLoader |
getClassLoader()
|
java.lang.String |
getClassName()
Return the Java class name of this service. |
Context |
getContext()
|
java.lang.String |
getDefaultDescription()
Return the default description. |
java.lang.String |
getDescription()
Return the service description. |
protected XURL[] |
getEndpoints()
|
IInstantiator |
getInstantiator()
|
protected java.lang.Class[] |
getInterfaces()
|
java.lang.Class |
getJavaClass()
Return the Java class of this service. |
protected MethodDescriptor[] |
getMethods()
|
int |
getMode()
Return the activation mode. |
static int |
getMode(java.lang.String string)
Return the code associated with the specified mode string, or -1 if not found. |
java.lang.String |
getModeString()
Return the activation mode as a string. |
java.lang.Object |
getObject()
Return an instance of my associated Java class according to my current activation mode. |
java.lang.String |
getPath()
Return the path of this service relative to the root of the local registry. |
java.lang.String |
getPath(java.lang.Object object)
Return "" if this service manages the specified object, otherwise return null. |
IReference |
getReference()
Return a reference to this service. |
WSDL |
getWSDL()
Return WSDL for this service. |
Value |
invoke(java.lang.reflect.Method method,
java.lang.Object[] args,
Context context)
Invoke the operation associated with a particular method, using the specified arguments. |
Value |
invoke(java.lang.String method,
java.lang.Object[] args,
java.lang.Class[] argTypes,
Context context)
Invoke the operation associated with a particular method, using the specified arguments and argument types. |
Value |
invoke(java.lang.String method,
java.lang.String[] args,
Context context)
Invoke the operation associated with a particular method, using the specified arguments. |
void |
setClass(java.lang.Class javaClass)
Set the Java class name of this service. |
void |
setContext(Context context)
|
void |
setDescription(java.lang.String description)
Set the service description. |
void |
setInstantiator(IInstantiator instantiator)
|
void |
setMode(int mode)
Set the activation mode. |
void |
setMode(java.lang.String string)
Set the activation mode. |
protected void |
setObject(java.lang.Object object)
|
java.lang.String |
toString()
Return a description of this service. |
static void |
validateClassName(java.lang.String className)
Throw an exception if the specified class name is invalid. |
static void |
validateMode(java.lang.String string)
Throw an exception if the specified mode string is invalid. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected ObjectService()
public ObjectService(java.lang.Object object)
object
- The object.public ObjectService(java.lang.String className)
className
- The class name.Method Detail |
public java.lang.String toString()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public Context getContext()
getContext
in interface IContextHolder
public void setContext(Context context)
setContext
in interface IContextHolder
context
- public java.lang.String getPath()
Registry.publish(java.lang.String, java.lang.Object)
,
Registry.getPath(java.lang.String, java.lang.Object)
,
Registry.getRegistryPaths(java.lang.Object)
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- public java.lang.String getDefaultDescription()
public java.lang.Object getObject()
public void setInstantiator(IInstantiator instantiator)
setInstantiator
in interface INeedInstantiator
instantiator
- public IInstantiator getInstantiator()
protected void setObject(java.lang.Object object)
object
- public java.lang.String getClassName()
public void setClass(java.lang.Class javaClass)
javaClass
- The new class name.public static void validateClassName(java.lang.String className) throws java.lang.IllegalArgumentException
className
- The class name to validate.
java.lang.IllegalArgumentException
- If the class name is invalid.public java.lang.Class getJavaClass()
public void setMode(int mode)
mode
- The new mode.public int getMode()
public static int getMode(java.lang.String string)
string
- The mode as a string.public java.lang.String getModeString()
public void setMode(java.lang.String string) throws java.lang.IllegalArgumentException
string
- The new mode as a string.
java.lang.IllegalArgumentException
- If the string is invalid.public static void validateMode(java.lang.String string) throws java.lang.IllegalArgumentException
string
- The mode as a string.
java.lang.IllegalArgumentException
- If the string is invalid.protected java.lang.Class[] getInterfaces() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected MethodDescriptor[] getMethods() throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
public java.lang.String getPath(java.lang.Object object) throws DirectoryException
getPath
in interface IContainer
object
- The object to find.
DirectoryException
- If an internal exception occurs.public Value invoke(java.lang.reflect.Method method, java.lang.Object[] args, Context context) throws java.lang.Throwable
invoke
in interface IReference
method
- The method to invokeargs
- The arguments.context
- The context.
java.lang.Throwable
- If an exception occurs.public Value invoke(java.lang.String method, java.lang.Object[] args, java.lang.Class[] argTypes, Context context) throws java.lang.Throwable
invoke
in interface IReference
method
- The name of the method to invokeargs
- The arguments.argTypes
- The type of the arguments.context
- The context.
java.lang.Throwable
- If an exception occurs.public Value invoke(java.lang.String method, java.lang.String[] args, Context context) throws java.lang.Throwable
invoke
in interface IReference
method
- The name of the method to invokeargs
- The arguments, expressed as strings.context
- The context.
java.lang.Throwable
- If an exception occurs.public java.lang.ClassLoader getClassLoader()
getClassLoader
in interface IHasClassLoader
public IReference getReference()
getReference
in interface IService
public WSDL getWSDL()
getWSDL
in interface IService
protected XURL[] getEndpoints() throws java.net.MalformedURLException
java.net.MalformedURLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |