Skip navigation links

Oracle® On Track Communication SDK Documentation
Release 1(1.0)

E20955-01


waggle.core.api
Class XAPIPackage

java.lang.Object
  extended by waggle.core.api.XAPIPackage


public final class XAPIPackage
extends Object

This is the API call package.


Constructor Summary
XAPIPackage()
          Create an empty XAPIPackage.
XAPIPackage(String moduleName, String methodName, Object[] arguments)
          Create a populated XAPIPackage.
XAPIPackage(String moduleName, String methodName, Object[] arguments, String traceID)
          Create a populated XAPIPackage.

 

Method Summary
 Object execute(boolean remote)
          Execute this XAPIPackage call.
 Object[] getMethodArguments()
          Return the method arguments.
 String getMethodName()
          Returns the method name.
 String getModuleName()
          Returns the module name.
 int getNMethodArguments()
          Return the number of method arguments.
static String getThreadTraceID()
          Get the thread's trace ID value.
 String getTraceID()
          Return any trace ID.
 boolean isModuleLocal()
          Determine if the specified module name is registered locally.
 waggle.core.serializer.XJSONSerializer serializeToJSON()
          Serialize an XAPIPackage as JSON.
 String serializeToJSONString()
          Serialize an XAPIPackage as JSON String.
 waggle.core.serializer.XXMLSerializer serializeToXML()
          Serialize an XAPIPackage as XML.
 String serializeToXMLString()
          Serialize an XAPIPackage as XML String.
 void setMethodInfo(String moduleName, String methodName, Object[] arguments, String traceID)
          Set the call information into an addressed XAPIPackage.
static void setThreadTraceID(String traceID)
          Set the thread's trace ID value.
<T extends XAPIInterface>
T
stuff(Class<T> interfaceClass)
          Stuff an XAPIPackage.
 String toString()
          The toString() result should look like a method call.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

XAPIPackage

public XAPIPackage()
Create an empty XAPIPackage.

XAPIPackage

public XAPIPackage(String moduleName,
                   String methodName,
                   Object[] arguments)
Create a populated XAPIPackage. The traceID will come from the thread local.
Parameters:
moduleName - The module name.
methodName - The method name.
arguments - The arguments.

XAPIPackage

public XAPIPackage(String moduleName,
                   String methodName,
                   Object[] arguments,
                   String traceID)
Create a populated XAPIPackage.
Parameters:
moduleName - The module name.
methodName - The method name.
arguments - The arguments.
traceID - Any trace ID. May be null.

Method Detail

setMethodInfo

public void setMethodInfo(String moduleName,
                          String methodName,
                          Object[] arguments,
                          String traceID)
Set the call information into an addressed XAPIPackage.
Parameters:
moduleName - The Module.
methodName - The Method.
arguments - The Arguments.
traceID - Any trace ID. May be null.

getModuleName

public String getModuleName()
Returns the module name.
Returns:
The module name.

getMethodName

public String getMethodName()
Returns the method name.
Returns:
The method name.

getMethodArguments

public Object[] getMethodArguments()
Return the method arguments.
Returns:
The method arguments.

getNMethodArguments

public int getNMethodArguments()
Return the number of method arguments.
Returns:
The number of method arguments.

getTraceID

public String getTraceID()
Return any trace ID.
Returns:
Any trace ID. May be null.

isModuleLocal

public boolean isModuleLocal()
Determine if the specified module name is registered locally.
Returns:
True if it is registered locally.

execute

public Object execute(boolean remote)
               throws Throwable
Execute this XAPIPackage call.
Parameters:
remote - This execute comes from an remote client.
Returns:
Method return value.
Throws:
Throwable - Lots of stuff.

serializeToXML

public waggle.core.serializer.XXMLSerializer serializeToXML()
Serialize an XAPIPackage as XML.
Returns:
The serialized XAPIPackage.

serializeToJSON

public waggle.core.serializer.XJSONSerializer serializeToJSON()
Serialize an XAPIPackage as JSON.
Returns:
The serialized XAPIPackage.

serializeToXMLString

public String serializeToXMLString()
Serialize an XAPIPackage as XML String.
Returns:
The serialized XAPIPackage.

serializeToJSONString

public String serializeToJSONString()
Serialize an XAPIPackage as JSON String.
Returns:
The serialized XAPIPackage.

toString

public String toString()
The toString() result should look like a method call.
Overrides:
toString in class Object
Returns:
The package formatted as a method call string.

stuff

public <T extends XAPIInterface> T stuff(Class<T> interfaceClass)
Stuff an XAPIPackage.

Servers can use this to stuff a package to be sent to a client on a back-channel.

Clients can use this to stuff a package to be sent to a server on a front-channel.

Type Parameters:
T - The interface class.
Parameters:
interfaceClass - The interface class.
Returns:
An instance of the specified XAPIInterface which can be used to call a method in order to stuff an XAPIPackage.

getThreadTraceID

public static String getThreadTraceID()
Get the thread's trace ID value. May be null.
Returns:
The thread's trace ID value. May be null.

setThreadTraceID

public static void setThreadTraceID(String traceID)
Set the thread's trace ID value. May be null.
Parameters:
traceID - The thread's trace ID value. May be null.

Skip navigation links

Oracle® On Track Communication SDK Documentation
Release 1(1.0)

E20955-01


Copyright © 2011, Oracle and/or its affiliates. All rights reserved.