|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fulmine.rpc.RpcUtils
public abstract class RpcUtils
Contains various utility methods required for the RPC framework.
Constructor Summary | |
---|---|
RpcUtils()
|
Method Summary | |
---|---|
static Class<? extends IField>[] |
convertToFramework(Class<?>... nativeTypes)
Convert the array of native types to framework types |
static IField[] |
convertToFramework(Object... nativeArgs)
Convert the array from the native objects to framework objects |
static Object[] |
convertToNative(IField... frameworkArgs)
Convert the array from the framework objects to native objects |
static Class<? extends IField>[] |
createArgs(Class<? extends IField>... argTypes)
Create the argument types based on the Class objects passed in. |
static Class<? extends IField>[] |
getArgArray(String argumentTypes)
Complementary to getArgString |
static String |
getArgString(Class<? extends IField>... argumentTypes)
Return a comma separated string with the argument types |
static Class<? extends IField>[] |
getArgumentTypes(IField... args)
Get the argument types from the argument array passed in |
static String |
getSignature(String name,
Class<? extends IField>... argTypes)
Get the signature of an RPC identified by its name and argument types. |
static String |
getSignature(String name,
IField... args)
Get the signature of an RPC identified by its name and arguments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RpcUtils()
Method Detail |
---|
public static Class<? extends IField>[] getArgumentTypes(IField... args)
args
- the argument array
public static Class<? extends IField>[] createArgs(Class<? extends IField>... argTypes)
Class
objects passed in.
Note this method creates a new array for each call. If this
method is called frequently, consider caching the result.
argTypes
- the classes that form the RPC argument types
IRpcDefinition.getArgumentTypes()
public static String getArgString(Class<? extends IField>... argumentTypes)
argumentTypes
- the argument types to express as a single string
public static Class<? extends IField>[] getArgArray(String argumentTypes)
getArgString
argumentTypes
- a comma separated list of IField
simple class names
IField
instances representing the types and
order in the argument stringpublic static String getSignature(String name, Class<? extends IField>... argTypes)
name
- the RPC nameargTypes
- the argument types
public static String getSignature(String name, IField... args)
name
- the RPC nameargs
- the arguments
public static Object[] convertToNative(IField... frameworkArgs)
frameworkArgs
- the framework objects array
public static IField[] convertToFramework(Object... nativeArgs)
nativeArgs
- the native objects array
IllegalArgumentException
- if any of the native objects is not convertiblepublic static Class<? extends IField>[] convertToFramework(Class<?>... nativeTypes)
nativeTypes
- the native types to convert
IllegalArgumentException
- if any of the native types are not supported for conversion
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |