org.jibx.ws.server
Class ObjectDefinition

java.lang.Object
  extended by org.jibx.ws.server.ObjectDefinition
Direct Known Subclasses:
HandlerDefinition, InterceptorDefinition

public abstract class ObjectDefinition
extends Object

A base class for all definition classes that require an object to be instantiated. Two options are provided for defining the object:

If the declarative definition is used, the init() method must be called after the arguments have been set.


Method Summary
 Object getObject()
          Returns the defined object (if one has been defined), or otherwise a new instance of the declared class using the declared arguments.
 void init()
          Method called after configuration is complete.
 void setArgs(String[] args)
          Set arguments for construction of the specified handler class.
 void setClassName(String className)
          Set handler class name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public final void init()
                throws WsConfigurationException
Method called after configuration is complete. This validates that either an object has been defined (using setDefinedObject(Object)), or that the defined class is available with a constructor matching the defined arguments. Only string arguments are supported for this constructor, and the number of arguments must match the length of the array passed to setArgs(String[]).

Throws:
WsConfigurationException - if the class is not accessible or is not a handler class

setClassName

public final void setClassName(String className)
Set handler class name. Only required if setDefinedObject(Object) has not been called. The specified class must implement either the InHandler or OutHandler interface. A new instance of the specified handler class will be constructed for each service instance. To pass arguments to the construction of this class call the setArgs(String[]) method.

Parameters:
className - handler class name

setArgs

public final void setArgs(String[] args)
Set arguments for construction of the specified handler class. If this method is not called, the handler will be constructed using a no-args constructor of the specified handler class.

Parameters:
args - arguments to construct handler with

getObject

public final Object getObject()
                       throws WsConfigurationException
Returns the defined object (if one has been defined), or otherwise a new instance of the declared class using the declared arguments.

Returns:
object
Throws:
WsConfigurationException - if a new instance cannot be created


Project Web Site