public final class Broker
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Broker.State |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTUAL_OBJECT_NAME_PREFIX |
static java.lang.String |
APPSERVICE_PREFIX |
static int |
BASIC_CALL_MAX_RANGE |
static java.lang.String |
CALLBACK_PREFIX |
static java.lang.String |
CODELOCATION_PREFIX |
static int |
CONSTRUCTOR_SEMANTIC_ID |
static java.lang.String |
JOB_SERVICE |
static java.lang.String |
NETWORK_UUID |
static java.lang.String |
OBJECT_NAME_PREFIX |
static java.lang.String |
POPJAVA_CONFIG_PREFIX |
static int |
REQUEST_QUEUE_TIMEOUT_MS |
static java.lang.String |
TRACKING |
static java.lang.String |
UPNP |
| Modifier and Type | Method and Description |
|---|---|
void |
clearResourceAfterInvoke(Request request)
Remove the request from the request queue after invocation
|
void |
finalizeRequest(Request request)
Replace the request semantics if we are working with a PopJava Object with
the corresponding local annotation.
|
protected boolean |
findEndcoding(java.lang.String encoding)
Look for a specific encoding
|
POPAccessPoint |
getAccessPoint()
Return the access point of this broker
|
java.lang.String |
getLogPrefix()
Return the prefix for log file
|
protected java.lang.Class<?> |
getPOPObjectClass(java.lang.String className,
java.net.URLClassLoader urlClassLoader)
Return the class of the associated object
|
static POPRemoteCaller |
getRemoteCaller()
Get who is calling this method.
|
RequestQueue |
getRequestQueue()
The broker global request queue.
|
Broker.State |
getState()
Get information about the state of this broker
|
POPTracking |
getTracked(POPRemoteCaller caller)
Statistics on a single user.
|
POPRemoteCaller[] |
getTrackingUsers()
All the currently tracked users.
|
boolean |
initialize(java.util.List<java.lang.String> argvs)
Initialization of the broker-side
|
boolean |
invoke(Request request)
This method is responsible to dispatch the request between invokeConstructor
and invokeMethod
|
boolean |
isDaemon()
Get information about the deamon mode of this broker
|
boolean |
isTraking()
Is tracking enabled on Broker side.
|
boolean |
isUPNPEnabled()
Returns true if UPNP is enabled
|
void |
kill()
Kill the broker and its associated object
|
static void |
main(java.lang.String[] argvs)
Entry point for the Broker.
|
void |
onCloseConnection(java.lang.String source)
Decrement de connection counter and exit the broker if there is no more
connection
|
void |
onNewConnection()
Increment the connection counter
|
boolean |
popCall(Request request)
This method is responsible to handle the POP system call
|
boolean |
sendException(ComboxConnection combox,
POPException exception,
int requestId)
Send exception to the interface-side
|
void |
sendResponse(ComboxConnection combox,
POPBuffer buffer)
Send response to the interface-side
|
void |
serveRequest(Request request)
This method is responsible to handle the broker-side semantics for a request
|
void |
setState(Broker.State state)
Set state information of this broker
|
void |
treatRequests()
Main loop of this broker
|
public static final int REQUEST_QUEUE_TIMEOUT_MS
public static final int BASIC_CALL_MAX_RANGE
public static final int CONSTRUCTOR_SEMANTIC_ID
public static final java.lang.String CALLBACK_PREFIX
public static final java.lang.String CODELOCATION_PREFIX
public static final java.lang.String OBJECT_NAME_PREFIX
public static final java.lang.String ACTUAL_OBJECT_NAME_PREFIX
public static final java.lang.String APPSERVICE_PREFIX
public static final java.lang.String JOB_SERVICE
public static final java.lang.String POPJAVA_CONFIG_PREFIX
public static final java.lang.String NETWORK_UUID
public static final java.lang.String TRACKING
public static final java.lang.String UPNP
public Broker(POPObject object)
public void finalizeRequest(Request request)
request - The request to be queuedpublic boolean invoke(Request request) throws java.lang.InterruptedException
request - Request received from the interface-sidejava.lang.InterruptedException - if the any semaphore's operation failpublic void clearResourceAfterInvoke(Request request)
request - Request to be removedpublic void serveRequest(Request request) throws java.lang.InterruptedException
request - Request received from the interface-sidejava.lang.InterruptedException - if the any semaphore's operation failpublic boolean popCall(Request request)
request - Request received from the interface-sidepublic void kill()
public POPAccessPoint getAccessPoint()
public void treatRequests()
throws java.lang.InterruptedException
java.lang.InterruptedException - if the any semaphore's operation failpublic void onNewConnection()
public void onCloseConnection(java.lang.String source)
public boolean isDaemon()
public boolean isTraking()
public static POPRemoteCaller getRemoteCaller()
public Broker.State getState()
public void setState(Broker.State state)
state - state to set to this brokerprotected boolean findEndcoding(java.lang.String encoding)
encoding - Encoding to look forpublic boolean initialize(java.util.List<java.lang.String> argvs)
argvs - Argumentsprotected java.lang.Class<?> getPOPObjectClass(java.lang.String className,
java.net.URLClassLoader urlClassLoader)
throws java.lang.ClassNotFoundException
className - Name of the classurlClassLoader - Path of the classjava.lang.ClassNotFoundException - thrown if the class is not foundpublic static void main(java.lang.String[] argvs)
throws java.lang.InterruptedException
argvs - arguments of the programjava.lang.InterruptedException - if the any semaphore's operation failpublic boolean sendException(ComboxConnection combox, POPException exception, int requestId)
combox - Combox to send the exceptionexception - Exception to sendpublic void sendResponse(ComboxConnection combox, POPBuffer buffer)
combox - Combox to send the responsebuffer - Buffer to send trough the comboxpublic java.lang.String getLogPrefix()
public RequestQueue getRequestQueue()
public POPRemoteCaller[] getTrackingUsers()
Combox.getRemoteCaller() }public POPTracking getTracked(POPRemoteCaller caller)
caller - A caller remote locationpublic boolean isUPNPEnabled()