|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object php.java.bridge.http.ContextServer
public final class ContextServer
A bridge pattern which either uses the PipeContextServer or the SocketContextServer, depending on the OS and/or the security restrictions. On windows, which cannot use named pipes, a SocketContextServer is used. All other operating systems use a PipeContextServer unless the system property php.java.bridge.promiscuous is set to true or the system property php.java.bridge.no_pipe_server is set to true.
A ContextServer instance represents the current web context. When the PipeContextServer is used, there can be more than one PipeContextServer instance per classloader, the ContextFactory.get() checks if it is called with the same ContextServer and throws a SecurityException otherwise. So one cannot access contexts belonging to other web contexts.
The SocketContextServer uses only one server socket for all shared web contexts and cannot do any security checks.
SocketContextServer
Field Summary | |
---|---|
static java.lang.String |
ROOT_CONTEXT_SERVER_ATTRIBUTE
Only for internal use |
Constructor Summary | |
---|---|
ContextServer(java.lang.String contextName,
boolean promiscuous)
Create a new ContextServer using a thread pool. |
Method Summary | |
---|---|
void |
destroy()
Destroy the pipe or socket context server. |
AbstractChannelName |
getChannelName(IContextFactory currentCtx)
Return the channelName which be passed to the client as X_JAVABRIDGE_REDIRECT |
boolean |
isAvailable(java.lang.String channelName)
Check if either the pipe of the socket context server is available. |
boolean |
isPromiscuous()
|
void |
start(AbstractChannelName channelName,
ILogger logger)
Start a channel name. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ROOT_CONTEXT_SERVER_ATTRIBUTE
Constructor Detail |
---|
public ContextServer(java.lang.String contextName, boolean promiscuous)
contextName
- The the name of the web context to which this server belongs.Method Detail |
---|
public boolean isPromiscuous()
public void destroy()
public boolean isAvailable(java.lang.String channelName)
channelName
- The header value for X_JAVABRIDGE_CHANNEL, may be null.
public void start(AbstractChannelName channelName, ILogger logger)
channelName
- The ChannelName.
java.lang.IllegalStateException
- if there's no Pipe- or SocketContextServer availablepublic AbstractChannelName getChannelName(IContextFactory currentCtx)
currentCtx
- The current ContextFactory, see X_JAVABRIDGE_CONTEXT
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |