org.jboss.ejb3.endpoint
Interface Endpoint

All Known Implementing Classes:
AbstractEndpoint

public interface Endpoint

An endpoint is capable of handling invocation on an EJB instance. An endpoint might be session aware, in which case an session has to be obtained from the session factory. This session can then be used to call upon the endpoint.

Version:
$Revision: $
Author:
Carlo de Wolf

Method Summary
 SessionFactory getSessionFactory()
          The SessionFactory associated with this Endpoint, if the Endpoint is session aware.
 java.lang.Object invoke(java.io.Serializable session, java.lang.Class<?> invokedBusinessInterface, java.lang.reflect.Method method, java.lang.Object[] args)
          Invoke a method on an EJB endpoint.
 boolean isSessionAware()
           
 

Method Detail

getSessionFactory

SessionFactory getSessionFactory()
                                 throws java.lang.IllegalStateException
The SessionFactory associated with this Endpoint, if the Endpoint is session aware.

Returns:
the associated session factory
Throws:
java.lang.IllegalStateException - if this Endpoint is not session aware

invoke

java.lang.Object invoke(java.io.Serializable session,
                        java.lang.Class<?> invokedBusinessInterface,
                        java.lang.reflect.Method method,
                        java.lang.Object[] args)
                        throws java.lang.Throwable
Invoke a method on an EJB endpoint.

Parameters:
session - the identification of the EJB instance to invoke the method upon or null if the endpoint doesn't support sessions.
invokedBusinessInterface - the invokedBusinessInterface or null if not known.
method - the method to invoke on the EJB instance, note that if invokedBusinessInterface is specified then the declaring class of the Method object must be an instance of the specified Class invokedBusinessInterface.
args - an array of objects containing the values of the arguments passed in the method invocation on the proxy instance, or null if interface method takes no arguments. Arguments of primitive types are wrapped in instances of the appropriate primitive wrapper class, such as java.lang.Integer or java.lang.Boolean.
Returns:
the return value of the invoked Method method.
Throws:
java.lang.Throwable - the exception to throw from the method invocation on the EJB instance.

isSessionAware

boolean isSessionAware()
Returns:
true if this Endpoint is session aware


Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.