org.codehaus.xfire.service.binding
Class ObjectInvoker

java.lang.Object
  extended by org.codehaus.xfire.service.binding.ObjectInvoker
All Implemented Interfaces:
Invoker
Direct Known Subclasses:
BeanInvoker, ServiceInvoker, ServiceInvoker

public class ObjectInvoker
extends java.lang.Object
implements Invoker

An invoker which instantiates classes automatically based on the Service's scope. The default scope is SCOPE_APPLICATION, which creates once instance to use for the lifetime of the invoker.

Since:
Nov 16, 2004
Author:
Dan Diephouse

Field Summary
static int SCOPE_APPLICATION
          Scope to denote that a single implementation instance should exist for the lifetime of this invoker and should be reused for every request.
static int SCOPE_REQUEST
          Scope to denote that a new instance of the service implementation should be created on every call.
static int SCOPE_SESSION
          Scope for storing one object per session.
static java.lang.String SERVICE_IMPL_CLASS
          Constant to denote the implementation class for the service.
 
Constructor Summary
ObjectInvoker()
           
 
Method Summary
 java.lang.Object createServiceObject(Service service)
          Override this method to control how XFire creates the service object.
 int getScope()
           
 java.lang.Object getServiceObject(MessageContext context)
          Creates and returns a service object depending on the scope.
 java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object[] params, MessageContext context)
           
 void setScope(int scope)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCOPE_APPLICATION

public static final int SCOPE_APPLICATION
Scope to denote that a single implementation instance should exist for the lifetime of this invoker and should be reused for every request.

See Also:
Constant Field Values

SCOPE_REQUEST

public static final int SCOPE_REQUEST
Scope to denote that a new instance of the service implementation should be created on every call.

See Also:
Constant Field Values

SCOPE_SESSION

public static final int SCOPE_SESSION
Scope for storing one object per session. An example of a session implementation is an http session, whereby one object is created per session and stored in the session scope.

See Also:
Constant Field Values

SERVICE_IMPL_CLASS

public static final java.lang.String SERVICE_IMPL_CLASS
Constant to denote the implementation class for the service.

See Also:
Constant Field Values
Constructor Detail

ObjectInvoker

public ObjectInvoker()
Method Detail

invoke

public java.lang.Object invoke(java.lang.reflect.Method method,
                               java.lang.Object[] params,
                               MessageContext context)
                        throws XFireFault
Specified by:
invoke in interface Invoker
Throws:
XFireFault

getServiceObject

public java.lang.Object getServiceObject(MessageContext context)
                                  throws XFireFault
Creates and returns a service object depending on the scope.

Throws:
XFireFault

createServiceObject

public java.lang.Object createServiceObject(Service service)
                                     throws XFireFault
Override this method to control how XFire creates the service object.

Parameters:
service -
Returns:
Throws:
XFireFault

getScope

public int getScope()

setScope

public void setScope(int scope)


Copyright © 2004-2005 Codehaus. All Rights Reserved.