|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.net.connector.AbstractManagedConnection | +--org.exolab.jms.net.multiplexer.MultiplexedManagedConnection
A ManagedConnection
that uses a Multiplexer
to multiplex
data over an Endpoint
Constructor Summary | |
MultiplexedManagedConnection(Authenticator authenticator)
Construct a new server MultiplexedManagedConnection . |
|
MultiplexedManagedConnection(java.security.Principal principal)
Construct a new client MultiplexedManagedConnection . |
Method Summary | |
void |
closed()
Invoked when the connection is closed by the peer. |
protected abstract Endpoint |
createEndpoint()
Creates the endpoint to multiplex data over. |
protected Multiplexer |
createMultiplexer(Endpoint endpoint,
Authenticator authenticator)
Create a new server-side multiplexer. |
protected Multiplexer |
createMultiplexer(Endpoint endpoint,
java.security.Principal principal)
Create a new client-side multiplexer. |
void |
destroy()
Destroys the physical connection. |
void |
error(java.lang.Throwable error)
Invoked when an error occurs on the multiplexer. |
protected Caller |
getCaller()
Helper to return an Caller instance, denoting the client
performing a method invocation. |
Connection |
getConnection()
Creates a new connection handle for the underlying physical connection. |
protected java.lang.String |
getDisplayName()
Helper to generate a descriptive name, for display purposes. |
java.security.Principal |
getPrincipal()
Returns the principal associated with this connection. |
protected java.lang.ThreadGroup |
getThreadGroup()
Returns the thread group to associate with allocated threads. |
boolean |
hasPrincipal(java.security.Principal principal)
Determines if the security principal that owns this connection is the same as that supplied. |
protected Response |
invoke(Connection connection,
Request request)
Invoke a method on a remote object. |
protected boolean |
isClient()
Helper to determine if this is a client-side or server side instance. |
void |
ping()
Ping the connection. |
void |
pinged(int token)
Notifies of a successful ping. |
void |
request(org.exolab.jms.net.multiplexer.Channel channel)
Invoked for an invocation request. |
void |
setInvocationHandler(InvocationHandler handler)
Registers a handler for handling invocations on objects exported via this connection. |
Methods inherited from class org.exolab.jms.net.connector.AbstractManagedConnection |
getConnectionEventListener, notifyClosed, notifyError, setConnectionEventListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.exolab.jms.net.connector.ManagedConnection |
getLocalURI, getRemoteURI |
Constructor Detail |
public MultiplexedManagedConnection(java.security.Principal principal)
MultiplexedManagedConnection
.principal
- the security principal. May be null
public MultiplexedManagedConnection(Authenticator authenticator)
MultiplexedManagedConnection
.authenticator
- the connection authenticatorMethod Detail |
public void setInvocationHandler(InvocationHandler handler) throws ResourceException
handler
- the invocation handlerIllegalStateException
- if a handler is already registeredResourceException
- for any errorpublic Connection getConnection() throws IllegalStateException
IllegalStateException
- if an invocation handler hasn't been
registeredpublic void ping() throws ResourceException
IllegalStateException
- if a connection is not establishedResourceException
- for any errorpublic void destroy() throws ResourceException
ResourceException
- for any errorpublic java.security.Principal getPrincipal()
null if none is set
public boolean hasPrincipal(java.security.Principal principal)
setInvocationHandler(org.exolab.jms.net.connector.InvocationHandler)
principal
- the principal to compare. May be null
.true
if the principal that owns this connection is
the same as principal
public void request(org.exolab.jms.net.multiplexer.Channel channel)
request
in interface MultiplexerListener
channel
- the channel the invocation is onpublic void closed()
closed
in interface MultiplexerListener
public void error(java.lang.Throwable error)
error
in interface MultiplexerListener
error
- the errorpublic void pinged(int token)
pinged
in interface MultiplexerListener
token
- the token sent in the pingprotected Response invoke(Connection connection, Request request)
connection
- the connection invoking the requestrequest
- the requestprotected abstract Endpoint createEndpoint() throws java.io.IOException
java.io.IOException
- for any I/O errorprotected Multiplexer createMultiplexer(Endpoint endpoint, java.security.Principal principal) throws java.io.IOException, SecurityException
endpoint
- the endpoint to multiplex messages overprincipal
- the security principaljava.io.IOException
- if an I/O error occursSecurityException
- if connection is refused by the serverprotected Multiplexer createMultiplexer(Endpoint endpoint, Authenticator authenticator) throws java.io.IOException, ResourceException
endpoint
- the endpoint to multiplex messages overauthenticator
- the connection authetnicatorjava.io.IOException
- if an I/O error occursResourceException
- if the authenticator cannot authenticateprotected boolean isClient()
true
if this is a client-side instance, otherwise
false
protected Caller getCaller()
Caller
instance, denoting the client
performing a method invocation. Only applicable for server-side, and only
after the multiplexer has been created.null
if it hasn't been
initialisedprotected java.lang.ThreadGroup getThreadGroup()
null
to use the default thread group.protected java.lang.String getDisplayName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |