php.java.bridge.http
Class AbstractChannelName

java.lang.Object
  extended by php.java.bridge.http.AbstractChannelName

public abstract class AbstractChannelName
extends java.lang.Object

Represents the pipe or socket channel name.

Author:
jostb

Constructor Summary
AbstractChannelName(java.lang.String name, java.lang.String kontext, IContextFactory currentCtx)
          Create a new ChannelName.
 
Method Summary
 IContextFactory getCtx()
          Return the
 java.lang.String getDefaultName()
          Returns the default (persistent) name of the channel, if it exists.
 java.lang.String getKontext()
           
 java.lang.String getName()
          Returns the name of the channel, for example the socket # or the pipe name.
 boolean hasDefault()
          Check if the default name exists, see X_JAVABRIDGE_CONTEXT_DEFAULT
 ContextRunner schedule()
          Check if there's a persistent ContextRunner available for the kontext.
 boolean start()
          Start a new ContextRunner for a given ContextServer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractChannelName

public AbstractChannelName(java.lang.String name,
                           java.lang.String kontext,
                           IContextFactory currentCtx)
Create a new ChannelName.

Parameters:
name - The name of the channel, see X_JAVABRIDGE_CHANNEL
kontext - The name of client's default context, see X_JAVABRIDGE_CONTEXT_DEFAULT
currentCtx - The ContextFactory associated with the current request.
Method Detail

getName

public java.lang.String getName()
Returns the name of the channel, for example the socket # or the pipe name.

Returns:
the name of the channel

getDefaultName

public java.lang.String getDefaultName()
Returns the default (persistent) name of the channel, if it exists. Otherwise it returns the name.

Returns:
the persistent name of the channel from X_JAVABRIDGE_CONTEXT_DEFAULT.
See Also:
getName()

hasDefault

public boolean hasDefault()
Check if the default name exists, see X_JAVABRIDGE_CONTEXT_DEFAULT

Returns:
true, if the persistent name exists, false otherwise.

getCtx

public IContextFactory getCtx()
Return the

Returns:
the value for X_JAVABRIDGE_CONTEXT.

getKontext

public java.lang.String getKontext()
Returns:
the value for X_JAVABRIDGE_CONTEXT_DEFAULT.
See Also:
getDefaultName()

schedule

public ContextRunner schedule()
Check if there's a persistent ContextRunner available for the kontext. After calling this method the persistent name can be queried with getDefaultName() and hasDefault().

Returns:
the default name or null.

start

public boolean start()
Start a new ContextRunner for a given ContextServer. The current ContextFactory becomes the default for this runner.

Returns:
true, if the channel is available, false otherwise.