|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.tools.util.DirectCallMessager
org.sandev.tools.util.AuthorizedJMSMessager
public class AuthorizedJMSMessager
A Messager implementation that sends nonlocal secure messages over JMS, and everything else via DirectCallMessager. So if you are doing a secure, synchronous call to node not in the same process space
Remote secure send is analogous but does not wait for any return value. All calls within the same process space go over the DirectCallMessager.
Whether a node can receive via JMS is determined by whether its instance name is found in the EntryPointsCSV global param. Only those node instances will be set up as JMS listener topics. Any given destination that is not the name of a local node is assumed to be an outbound topic send.
| Field Summary | |
|---|---|
protected javax.jms.TopicConnection |
connection
Our topic connection. |
protected javax.naming.Context |
context
The JNDI context we use for looking up JMS related stuff. |
static java.lang.String |
ERRORPREFIX
When we have a framework failure that prevents us from returning an actual message, return this text followed by any descriptive details. |
static java.lang.String |
EXTERNALRECEIVERSCSV
The name of the global config parameter containing the comma separated list of node instance names that receive messages from outside their local runtime environment. |
static java.lang.String |
EXTERNALSENDONLYCSV
The name of the global config parameter containing the comma separated list of node instance names that only send messages to outside their local runtime environment. |
protected boolean |
isReceiver
True if this instance receives messages from outside of the local runtime environment. |
protected boolean |
isSender
True if this instance sends messages outside of the local runtime environment. |
static java.lang.String |
JMS_CONTEXTFACTORYCLASS
The name of the global config parameter containing the fully qualified name of the JMS context factory class. |
static java.lang.String |
JMS_CONTEXTPROVIDERURL
The name of the global config parameter containing the URL of the context provider. |
static java.lang.String |
JMS_EXTRAPROP
Extra property to set for the initial JMS context |
static java.lang.String |
JMS_EXTRAVAL
Value of extra property set for the initial JMS context |
static int |
JMS_MAXEXTRAPROPS
Additional properties and values can be specified starting with JMSExtraProp2 and JMSExtraVal2 up through the max defined here. |
static java.lang.String |
JMS_PASSWORD
The JMS password to use when connecting |
static java.lang.String |
JMS_TIMEOUTSECONDS
The name of the global config parameter containing the number of seconds that JMS should wait before timing out. |
static java.lang.String |
JMS_TOPICCONNECTIONFACTORYNAME
The name of the JMS TopicConnectionFactory to retrieve when initializing a new TopicConnection. |
static java.lang.String |
JMS_USERNAME
The JMS username to use when connecting |
protected java.lang.String |
name
The name of our topic, which is the same as our node instance name. |
protected int |
responseTimeoutMillis
The maximum number of milliseconds to wait for a remote call response before timing out. |
protected javax.jms.TopicSession |
session
We use a single TopicSession for receiving since we are not doing JMS transactions |
| Fields inherited from class org.sandev.tools.util.DirectCallMessager |
|---|
ourInstance, ourNode, subTable |
| Fields inherited from interface org.sandev.basics.nodecommon.Messager |
|---|
MODE_DIRECT, MODE_INVALID, MODE_SECURE, OPTIMIZE_IF_POSSIBLE, OPTIMIZE_NEVER, WIRE_BASICSECURITY, WIRE_SECURECOMMS, WIRE_TRANSPORTONLY |
| Constructor Summary | |
|---|---|
AuthorizedJMSMessager()
|
|
| Method Summary | |
|---|---|
protected javax.jms.TopicConnection |
getConnection()
Return the connection or throw if it is null. |
protected javax.jms.TopicSession |
getSession()
Return the session or throw if it is null. |
int |
getWireSecurity()
Returns WIRE_BASICSECURITY. |
void |
init(org.sandev.basics.nodecommon.Messageable node,
org.sandev.basics.structs.NodeInstance instance)
|
protected void |
initConnection(org.sandev.basics.nodecommon.SandRoot sandRoot)
initializer for connection |
protected void |
initContext(org.sandev.basics.nodecommon.SandRoot sandRoot)
initializer for context |
protected void |
initResponseTimeoutMillis(org.sandev.basics.nodecommon.SandRoot sandRoot)
initializer for responseTimeoutMillis |
protected void |
initSession()
initializer for session |
void |
onMessage(javax.jms.Message msg)
Receive a JMS message, sick it into an AuthWrapper and pass it to the node. |
org.sandev.basics.structs.SandMessage |
query(org.sandev.basics.structs.SandMessage msg,
java.lang.String recipientInstanceName,
int optimize,
int mode,
java.lang.String localAuthorizerInstanceName)
Try this as a local query, and then try remote if that fails. |
void |
queryReceiver(org.sandev.basics.nodecommon.Messageable node,
java.lang.String messageClass,
java.lang.String localAuthorizerInstanceName)
Just calls through to the superclass. |
void |
send(org.sandev.basics.structs.SandMessage msg,
int optimize,
int mode,
java.lang.String localAuthorizerInstanceName)
Send the given message. |
void |
shutdown()
Close down the connection, which closes the session, producers and consumers. |
void |
subscribe(org.sandev.basics.nodecommon.Messageable node,
java.lang.String msgClass,
java.lang.String sender,
int optimize,
int mode,
java.lang.String localAuth,
org.sandev.basics.structs.SandAttrVal[] matchDescription)
Call the superclass if this is a local node, otherwise subscribe to the topic name given as the sender parameter. |
protected void |
tput(java.util.Hashtable properties,
java.lang.String prop,
java.lang.String val)
Set the property and write it out to the log so we can see what is going on. |
void |
unsubscribe(org.sandev.basics.nodecommon.Messageable node,
java.lang.String msgClass,
java.lang.String sender,
int optimize,
int mode,
java.lang.String localAuth)
Undo the identified subscription. |
| Methods inherited from class org.sandev.tools.util.DirectCallMessager |
|---|
addSubscriber, doQuery, doSend, doSend, doSubscribe, doUnsubscribe, error, getImplementationWireSecurity, getMessageable, getOurInstance, getOurNode, getSubTable, info, removeSubscriber, setOurInstance, setOurNode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String EXTERNALRECEIVERSCSV
public static final java.lang.String EXTERNALSENDONLYCSV
public static final java.lang.String JMS_TIMEOUTSECONDS
public static final java.lang.String JMS_CONTEXTFACTORYCLASS
public static final java.lang.String JMS_CONTEXTPROVIDERURL
public static final java.lang.String JMS_USERNAME
public static final java.lang.String JMS_PASSWORD
public static final java.lang.String JMS_EXTRAPROP
public static final java.lang.String JMS_EXTRAVAL
public static final int JMS_MAXEXTRAPROPS
public static final java.lang.String JMS_TOPICCONNECTIONFACTORYNAME
public static final java.lang.String ERRORPREFIX
protected javax.naming.Context context
protected javax.jms.TopicConnection connection
protected javax.jms.TopicSession session
protected int responseTimeoutMillis
protected java.lang.String name
protected boolean isSender
protected boolean isReceiver
| Constructor Detail |
|---|
public AuthorizedJMSMessager()
| Method Detail |
|---|
protected void initContext(org.sandev.basics.nodecommon.SandRoot sandRoot)
throws org.sandev.basics.nodecommon.MessagerException
org.sandev.basics.nodecommon.MessagerException
protected void tput(java.util.Hashtable properties,
java.lang.String prop,
java.lang.String val)
protected void initConnection(org.sandev.basics.nodecommon.SandRoot sandRoot)
throws org.sandev.basics.nodecommon.MessagerException
org.sandev.basics.nodecommon.MessagerException
protected javax.jms.TopicConnection getConnection()
throws org.sandev.basics.nodecommon.MessagerException
org.sandev.basics.nodecommon.MessagerException
protected void initSession()
throws org.sandev.basics.nodecommon.MessagerException
org.sandev.basics.nodecommon.MessagerException
protected javax.jms.TopicSession getSession()
throws org.sandev.basics.nodecommon.MessagerException
org.sandev.basics.nodecommon.MessagerException
protected void initResponseTimeoutMillis(org.sandev.basics.nodecommon.SandRoot sandRoot)
throws org.sandev.basics.nodecommon.MessagerException
org.sandev.basics.nodecommon.MessagerException
public void init(org.sandev.basics.nodecommon.Messageable node,
org.sandev.basics.structs.NodeInstance instance)
throws org.sandev.basics.nodecommon.MessagerException
init in interface org.sandev.basics.nodecommon.Messagerinit in class DirectCallMessagerorg.sandev.basics.nodecommon.MessagerExceptionpublic void shutdown()
shutdown in interface org.sandev.basics.nodecommon.Messagershutdown in class DirectCallMessager
public void send(org.sandev.basics.structs.SandMessage msg,
int optimize,
int mode,
java.lang.String localAuthorizerInstanceName)
throws org.sandev.basics.nodecommon.MessagerException
send in interface org.sandev.basics.nodecommon.Messagersend in class DirectCallMessagerorg.sandev.basics.nodecommon.MessagerException
public void subscribe(org.sandev.basics.nodecommon.Messageable node,
java.lang.String msgClass,
java.lang.String sender,
int optimize,
int mode,
java.lang.String localAuth,
org.sandev.basics.structs.SandAttrVal[] matchDescription)
throws org.sandev.basics.nodecommon.MessagerException
subscribe in interface org.sandev.basics.nodecommon.Messagersubscribe in class DirectCallMessagerorg.sandev.basics.nodecommon.MessagerException
public void unsubscribe(org.sandev.basics.nodecommon.Messageable node,
java.lang.String msgClass,
java.lang.String sender,
int optimize,
int mode,
java.lang.String localAuth)
throws org.sandev.basics.nodecommon.MessagerException
unsubscribe in interface org.sandev.basics.nodecommon.Messagerunsubscribe in class DirectCallMessagerorg.sandev.basics.nodecommon.MessagerException
public org.sandev.basics.structs.SandMessage query(org.sandev.basics.structs.SandMessage msg,
java.lang.String recipientInstanceName,
int optimize,
int mode,
java.lang.String localAuthorizerInstanceName)
throws org.sandev.basics.nodecommon.MessagerException
query in interface org.sandev.basics.nodecommon.Messagerquery in class DirectCallMessagerorg.sandev.basics.nodecommon.MessagerException
public void queryReceiver(org.sandev.basics.nodecommon.Messageable node,
java.lang.String messageClass,
java.lang.String localAuthorizerInstanceName)
throws org.sandev.basics.nodecommon.MessagerException
queryReceiver in interface org.sandev.basics.nodecommon.MessagerqueryReceiver in class DirectCallMessagerorg.sandev.basics.nodecommon.MessagerExceptionpublic int getWireSecurity()
This Messager implementation always calls local Authorizers for serialization and encryption, so it is never WIRE_SECURECOMMS.
getWireSecurity in interface org.sandev.basics.nodecommon.MessagergetWireSecurity in class DirectCallMessagerpublic void onMessage(javax.jms.Message msg)
If all goes well to the extent that we get a message back, then that message gets serialized, encrypted, and returned. Otherwise
onMessage in interface javax.jms.MessageListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||