|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectphp.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.
PipeContextServer
,
SocketContextServer
Constructor Summary | |
---|---|
ContextServer(java.lang.String contextName)
Create a new ContextServer using a thread pool. |
Method Summary | |
---|---|
void |
destroy()
Destroy the pipe or socket context server. |
ContextFactory.ICredentials |
getCredentials(java.lang.String channelName)
Return the credentials provided by the ContextServer. |
AbstractChannelName |
getFallbackChannelName(java.lang.String channelName,
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. |
void |
start(AbstractChannelName channelName)
Start a channel name. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContextServer(java.lang.String contextName)
contextName
- The the name of the web context to which this server belongs.Method Detail |
---|
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)
channelName
- The ChannelName.
java.lang.IllegalStateException
- if there's no Pipe- or SocketContextServer availablepublic AbstractChannelName getFallbackChannelName(java.lang.String channelName, IContextFactory currentCtx)
channelName
- The name of the channel, see X_JAVABRIDGE_CHANNELcurrentCtx
- The current ContextFactory, see X_JAVABRIDGE_CONTEXT
public ContextFactory.ICredentials getCredentials(java.lang.String channelName)
channelName
- The name of the channel, see X_JAVABRIDGE_CHANNEL
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 |