de.netseeker.ejoe.handler
Class BaseRemotingHandler

java.lang.Object
  extended by de.netseeker.ejoe.handler.BaseRemotingHandler
All Implemented Interfaces:
ClassRegistry, ServerHandler, java.io.Serializable
Direct Known Subclasses:
AssistedRemotingHandler, DefaultRemotingHandler

public abstract class BaseRemotingHandler
extends java.lang.Object
implements ServerHandler, ClassRegistry

Base class for the family of reflection based ServerHandlers. Basically these ServerHandlers allow the usage of remote method invocations which the EJOE Sever handles using:

Since:
0.3.9.1
Author:
netseeker
See Also:
Serialized Form

Field Summary
protected  java.util.Map classCache
          pre-cache all known Wrapper-Primitive-Pairs as well as all known Primitive-Wrapper-Pairs
 
Constructor Summary
BaseRemotingHandler()
           
 
Method Summary
 boolean deRegisterClassMapping(java.lang.String alias)
           
protected  java.lang.Class getClassByName(java.lang.String cName)
          Either loads a class via reflection or (if already cached) from a Class-cache
static java.lang.Class getPrimitiveForWrapper(java.lang.Class wrapper)
          Returns the appropiate primitive type for the given wrapper type, eg. int for Integer
static java.lang.Class getWrapperForPrimitive(java.lang.Class primitive)
          Returns the appropiate wrapper type for the given primitive type, eg.
 java.lang.Object handle(java.lang.Object params)
          Handles a client request
 void registerClassMapping(java.lang.String clazz, java.lang.String alias)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classCache

protected java.util.Map classCache
pre-cache all known Wrapper-Primitive-Pairs as well as all known Primitive-Wrapper-Pairs

Constructor Detail

BaseRemotingHandler

public BaseRemotingHandler()
Method Detail

handle

public java.lang.Object handle(java.lang.Object params)
                        throws java.lang.Exception
Description copied from interface: ServerHandler
Handles a client request

Specified by:
handle in interface ServerHandler
Parameters:
params - The input object transported by EJOE
Returns:
null or an valid return value. If you want return custom datatypes, eg. your own beans and don't want (or are not able) to deploy the classes of these datatypes on the client you can turn on EJOEs remote classloading feature.
Throws:
java.lang.Exception

getWrapperForPrimitive

public static java.lang.Class getWrapperForPrimitive(java.lang.Class primitive)
Returns the appropiate wrapper type for the given primitive type, eg. Integer for int

Parameters:
primitive - primitive java type
Returns:
appropiate java wrapper type

getPrimitiveForWrapper

public static java.lang.Class getPrimitiveForWrapper(java.lang.Class wrapper)
Returns the appropiate primitive type for the given wrapper type, eg. int for Integer

Parameters:
wrapper - java wrapper type
Returns:
appropiate java primitive type

getClassByName

protected java.lang.Class getClassByName(java.lang.String cName)
                                  throws java.lang.ClassNotFoundException,
                                         java.security.AccessControlException
Either loads a class via reflection or (if already cached) from a Class-cache

Parameters:
cName - complete name of the class with package names
Returns:
a Class
Throws:
java.lang.ClassNotFoundException
java.security.AccessControlException

registerClassMapping

public void registerClassMapping(java.lang.String clazz,
                                 java.lang.String alias)
Specified by:
registerClassMapping in interface ClassRegistry

deRegisterClassMapping

public boolean deRegisterClassMapping(java.lang.String alias)
Specified by:
deRegisterClassMapping in interface ClassRegistry


Copyright © 2005-2007 netseeker. All Rights Reserved.