|
||||||||||
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
hasPrincipal
public boolean hasPrincipal(java.security.Principal principal)
- Determines if the security principal that owns this connection is the
same as that supplied.
NOTE: If this is a server-side instance, the principal is only available
once the connection has been established, by setInvocationHandler(org.exolab.jms.net.connector.InvocationHandler)
- Parameters:
principal
- the principal to compare. May be null
.- Returns:
true
if the principal that owns this connection is
the same as principal
request
public void request(org.exolab.jms.net.multiplexer.Channel channel)
- Invoked for an invocation request.
- Specified by:
request
in interface MultiplexerListener
- Parameters:
channel
- the channel the invocation is on
closed
public void closed()
- Invoked when the connection is closed by the peer.
- Specified by:
closed
in interface MultiplexerListener
error
public void error(java.lang.Throwable error)
- Invoked when an error occurs on the multiplexer.
- Specified by:
error
in interface MultiplexerListener
- Parameters:
error
- the error
pinged
public void pinged(int token)
- Notifies of a successful ping.
- Specified by:
pinged
in interface MultiplexerListener
- Parameters:
token
- the token sent in the ping
invoke
protected Response invoke(Connection connection,
Request request)
- Invoke a method on a remote object.
- Parameters:
connection
- the connection invoking the requestrequest
- the request- Returns:
- the response
createEndpoint
protected abstract Endpoint createEndpoint()
throws java.io.IOException
- Creates the endpoint to multiplex data over.
- Returns:
- the endpoint to multiplex data over
- Throws:
java.io.IOException
- for any I/O error
createMultiplexer
protected Multiplexer createMultiplexer(Endpoint endpoint,
java.security.Principal principal)
throws java.io.IOException,
SecurityException
- Create a new client-side multiplexer.
- Parameters:
endpoint
- the endpoint to multiplex messages overprincipal
- the security principal- Returns:
- a new client-side multiplexer
- Throws:
java.io.IOException
- if an I/O error occursSecurityException
- if connection is refused by the server
createMultiplexer
protected Multiplexer createMultiplexer(Endpoint endpoint,
Authenticator authenticator)
throws java.io.IOException,
ResourceException
- Create a new server-side multiplexer.
- Parameters:
endpoint
- the endpoint to multiplex messages overauthenticator
- the connection authetnicator- Returns:
- a new server-side multiplexer
- Throws:
java.io.IOException
- if an I/O error occursResourceException
- if the authenticator cannot authenticate
isClient
protected boolean isClient()
- Helper to determine if this is a client-side or server side instance.
- Returns:
true
if this is a client-side instance, otherwise
false
getCaller
protected Caller getCaller()
- Helper to return an
Caller
instance, denoting the client
performing a method invocation. Only applicable for server-side, and only
after the multiplexer has been created.
- Returns:
- the caller instance, or
null
if it hasn't been
initialised
getThreadGroup
protected java.lang.ThreadGroup getThreadGroup()
- Returns the thread group to associate with allocated threads.
- Returns:
- the thread group to associate with allocated threads, or
null
to use the default thread group.
getDisplayName
protected java.lang.String getDisplayName()
- Helper to generate a descriptive name, for display purposes.
This implementation returns the remote URI, concatenated with "[client]"
if this is a client connection, or "[server]" if it is a server
connection.
- Returns:
- the display name
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.