org.clazzes.remoting.beans
Class BeanCallbackWrapper

java.lang.Object
  extended by org.clazzes.remoting.beans.BeanCallbackWrapper
All Implemented Interfaces:
CallbackWrapper, Initializable

public class BeanCallbackWrapper
extends java.lang.Object
implements CallbackWrapper, Initializable

This ServerInvocationHandler delegates remote callbacks to a bean by intelligently discovering the service interface.

Author:
wglas

Constructor Summary
BeanCallbackWrapper()
           
 
Method Summary
 java.lang.Class<?> getServiceInterface()
           
 InvocationHandler getWrapper(java.lang.Object target)
           
 void initialize()
          Initialize the internal state of this bean.
 boolean isInitialized()
           
 void setServiceInterface(java.lang.Class<?> serviceInterface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanCallbackWrapper

public BeanCallbackWrapper()
Method Detail

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface Initializable
Returns:
Whether this bean needs to be initialized using Initializable.initialize().

initialize

public void initialize()
                throws java.lang.Exception
Description copied from interface: Initializable
Initialize the internal state of this bean.

Specified by:
initialize in interface Initializable
Throws:
java.lang.Exception - Upon errors.

getWrapper

public InvocationHandler getWrapper(java.lang.Object target)
Specified by:
getWrapper in interface CallbackWrapper
Parameters:
target - The target object to be called, which has to implement the interface returned by CallbackWrapper.getServiceInterface().
Returns:
A handler, which delegates callback to the given object.

getServiceInterface

public java.lang.Class<?> getServiceInterface()
Specified by:
getServiceInterface in interface CallbackWrapper
Returns:
The interface handled by this callback handler.

setServiceInterface

public void setServiceInterface(java.lang.Class<?> serviceInterface)
Parameters:
serviceInterface - the serviceInterface to set


Copyright © 2010. All Rights Reserved.