|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xmlBlaster.util.qos.address.AddressBase
public abstract class AddressBase
Abstract helper class holding connect address and callback address string and protocol string.
See examples in the implementing classes
Address
,
CallbackAddress
,
AddressBaseTest
Field Summary | |
---|---|
private PropString |
bootstrapHostname
|
private PropInt |
bootstrapPort
|
protected PropLong |
burstModeMaxBytes
|
protected PropInt |
burstModeMaxEntries
|
private java.lang.Object |
callbackDriver
|
protected java.lang.String |
className
|
protected PropLong |
collectTime
|
protected PropString |
compressType
|
protected java.lang.String |
context
|
static int |
DEFAULT_bootstrapPort
|
static long |
DEFAULT_burstModeMaxBytes
|
static int |
DEFAULT_burstModeMaxEntries
|
static long |
DEFAULT_collectTime
BurstMode: The time to collect messages for publish/update |
static java.lang.String |
DEFAULT_compressType
Compress messages if set to "gzip" or "zip" |
static boolean |
DEFAULT_dispatcherActive
|
java.lang.String |
DEFAULT_dispatchPlugin
Does client whish a dispatcher plugin. |
static long |
DEFAULT_minSize
Messages bigger this size in bytes are compressed |
static boolean |
DEFAULT_oneway
Shall the update() or publish() messages be send oneway (no application level ACK). |
static boolean |
DEFAULT_ptpAllowed
PtP messages wanted? Defaults to true, false prevents spamming |
static java.lang.String |
DEFAULT_sessionId
The identifier sent to the callback client, the client can decide if he trusts this invocation |
boolean |
DEFAULT_stallOnPingTimeout
Setting this property will not throw an exception on pings when a ping response timeout is detected. |
static java.lang.String |
DEFAULT_type
The unique protocol type, defaults to SOCKET |
static boolean |
DEFAULT_useForSubjectQueue
Shall this session callback be used for subjectQueue messages as well? For <callback> only |
static java.lang.String |
DEFAULT_version
The protocol version, e.g. |
protected PropLong |
delay
|
protected PropBoolean |
dispatcherActive
Control if the dispatcher is activated on login, i.e. |
protected PropString |
dispatchPlugin
|
protected java.lang.String |
envPrefix
For example "plugin/socket/" |
protected boolean |
fromPersistenceRecovery
Marker if message comes from persistent store and is recovered after a server restart. |
protected Global |
glob
|
protected java.lang.String |
instanceName
|
private static java.util.logging.Logger |
log
|
protected PropLong |
minSize
|
protected java.lang.String |
nodeId
The node id to which we want to connect |
protected PropBoolean |
oneway
|
protected PropLong |
pingInterval
|
private ClientPropertiesInfo |
pluginAttributes
|
private java.util.Properties |
pluginInfoParameters
|
protected PropBoolean |
ptpAllowed
|
private PropString |
rawAddress
The unique address, e.g. |
protected PropInt |
retries
|
protected java.lang.String |
rootTag
The root xml element: <callback> or <address>, is set from the derived class |
protected PropString |
sessionId
|
protected SessionName |
sessionName
|
protected PropBoolean |
stallOnPingTimeout
|
protected PropString |
type
|
protected PropBoolean |
useForSubjectQueue
|
protected PropString |
version
|
Constructor Summary | |
---|---|
AddressBase(Global glob,
java.lang.String rootTag)
|
Method Summary | |
---|---|
void |
addClientProperty(ClientProperty clientProperty)
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
java.lang.StringBuffer character)
Handle SAX parsed end element |
java.lang.String |
getBootstrapHostname()
|
int |
getBootstrapPort()
|
java.lang.String |
getBootstrapUrl()
Returns a URL markup of the bootstrap server, currently it looks like xmlBlaster://myServer.com:3412 but will probably change in a future release. |
long |
getBurstModeMaxBytes()
How many bytes maximum shall the callback thread take in one bulk out of the callback queue and deliver to the client in one bulk. |
int |
getBurstModeMaxEntries()
How many messages maximum shall the callback thread take in one bulk out of the callback queue and deliver to the client in one bulk. |
java.lang.Object |
getCallbackDriver()
|
AddressBase |
getClone()
|
long |
getCollectTime()
BurstMode: The time span to collect messages before sending. |
java.lang.String |
getCompressType()
Get the compression method. |
abstract long |
getDefaultDelay()
Delay between connection retries in milliseconds |
abstract long |
getDefaultPingInterval()
Ping interval: pinging every given milliseconds |
abstract int |
getDefaultRetries()
How often to retry if connection fails |
long |
getDelay()
Delay between callback retries in milliseconds, defaults to one minute |
java.lang.String |
getDispatchPlugin()
|
PropBoolean |
getEnv(java.lang.String key,
boolean defaultValue)
Plugins may query their properties here |
PropInt |
getEnv(java.lang.String key,
int defaultValue)
Plugins may query their properties here |
PropLong |
getEnv(java.lang.String key,
long defaultValue)
Plugins may query their properties here |
PropString |
getEnv(java.lang.String key,
java.lang.String defaultValue)
Plugins may query their properties here |
java.lang.String |
getEnvLookupKey(java.lang.String key)
Returns the completed key which was found and chosen. |
java.lang.String |
getEnvPrefix()
|
java.lang.String |
getLogId()
|
long |
getMinSize()
Messages bigger this size in bytes are compressed. |
java.lang.String |
getName()
A nice human readable name for this address (used for logging) |
java.lang.String |
getOnExhaust()
What to do if max retries is exhausted. |
boolean |
getOnExhaustKillSession()
Kill login session if max callback retries is exhausted? |
long |
getPingInterval()
How long to wait between pings to the callback server. |
java.lang.String |
getRawAddress()
Returns the rawAddress which is specific for each protocol. |
int |
getRetries()
How often shall we retry callback attempt on callback failure |
java.lang.String |
getSecretSessionId()
The identifier sent to the callback client, the client can decide if he trusts this invocation |
SessionName |
getSessionName()
|
java.lang.String |
getSettings()
Show some important settings for logging |
java.lang.String |
getType()
Returns the protocol type. |
java.lang.String |
getVersion()
Returns the protocol version. |
boolean |
hasAttributeEnv(java.lang.String key)
|
boolean |
hasBootstrapHostname()
Check if a bootstrapHostname is set already |
protected void |
initialize()
Configure property settings. |
boolean |
isDispatcherActive()
|
boolean |
isFromPersistenceRecovery()
|
boolean |
isPtpAllowed()
|
boolean |
isSameAddress(AddressBase other)
Check if supplied address would connect to the address of this instance |
boolean |
isStallOnPingTimeout()
|
boolean |
oneway()
Shall the publish() or callback update() message be oneway. |
void |
setBootstrapHostname(java.lang.String host)
Updates the internal address as well. |
void |
setBootstrapPort(int bootstrapPort)
Set the bootstrapping port. |
void |
setBurstModeMaxBytes(long burstModeMaxBytes)
|
void |
setBurstModeMaxEntries(int burstModeMaxEntries)
|
void |
setCallbackDriver(java.lang.Object callbackDriver)
|
void |
setCollectTime(long collectTime)
BurstMode: The time to collect messages for sending in a bulk. |
void |
setCompressType(java.lang.String compressType)
|
void |
setDefaultBootstrapHostname(java.lang.String host)
|
void |
setDefaultBootstrapPort(int defaultBootstrapPort)
The creation default will be overwritten by the given defaultPort. |
void |
setDelay(long delay)
Delay between callback retries in milliseconds, defaults to one minute |
void |
setDispatcherActive(boolean dispatcherActive)
Inhibits/activates the delivery of asynchronous dispatches of messages. |
void |
setDispatchPlugin(java.lang.String dispatchPlugin)
Specify your dispatcher plugin configuration. |
void |
setFromPersistenceRecovery(boolean fromPersistenceRecovery)
|
void |
setMinSize(long minSize)
Messages bigger this size in bytes are compressed. |
void |
setOneway(boolean oneway)
Shall the publish() or callback update() message be oneway. |
void |
setPingInterval(long pingInterval)
How long to wait between pings to the callback server. |
void |
setPluginInfoParameters(java.util.Properties parameters)
Set the PluginInfo parameters (derived from xmlBlasterPlugins.xml or xmlBlaster.properties). |
void |
setPluginProperty(java.lang.String key,
java.lang.String value)
Set a protocol specific property. |
void |
setPtpAllowed(boolean ptpAllowed)
|
void |
setRawAddress(java.lang.String rawAddress)
Set the callback address, it should fit to the protocol-type. |
void |
setRetries(int retries)
How often shall we retry callback attempt on callback failure |
private void |
setRootTag(java.lang.String rootTag)
Sets the root xml tag, <callback> or <address> |
void |
setSecretSessionId(java.lang.String sessionId)
The identifier sent to the callback client, the client can decide if he trusts this invocation |
void |
setSessionName(SessionName sessionName)
|
void |
setStallOnPingTimeout(boolean stallOnPingTimeout)
|
void |
setType(java.lang.String type)
NOTE: This setting has precedence over all environment or command line settings |
void |
setVersion(java.lang.String version)
|
void |
shutdown()
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
java.lang.StringBuffer character,
org.xml.sax.Attributes attrs)
Called for SAX callback start tag |
java.lang.String |
toXml()
Dump state of this object into a XML ASCII string. |
java.lang.String |
toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string. |
java.lang.String |
usage()
Get a usage string for the connection parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Global glob
private static java.util.logging.Logger log
private ClientPropertiesInfo pluginAttributes
private java.util.Properties pluginInfoParameters
protected java.lang.String rootTag
protected java.lang.String instanceName
protected final java.lang.String className
protected final java.lang.String context
protected java.lang.String envPrefix
private PropString rawAddress
private PropString bootstrapHostname
public static final int DEFAULT_bootstrapPort
private PropInt bootstrapPort
public static final java.lang.String DEFAULT_type
protected PropString type
public static final java.lang.String DEFAULT_version
protected PropString version
public static final long DEFAULT_collectTime
protected PropLong collectTime
protected PropLong pingInterval
protected PropInt retries
protected PropLong delay
public static final boolean DEFAULT_oneway
protected PropBoolean oneway
public static final boolean DEFAULT_dispatcherActive
protected PropBoolean dispatcherActive
public static final java.lang.String DEFAULT_compressType
protected PropString compressType
public static final long DEFAULT_minSize
protected PropLong minSize
public static final int DEFAULT_burstModeMaxEntries
protected PropInt burstModeMaxEntries
public static final long DEFAULT_burstModeMaxBytes
protected PropLong burstModeMaxBytes
public static final boolean DEFAULT_ptpAllowed
protected PropBoolean ptpAllowed
public static final java.lang.String DEFAULT_sessionId
protected PropString sessionId
public static final boolean DEFAULT_useForSubjectQueue
protected PropBoolean useForSubjectQueue
protected SessionName sessionName
public java.lang.String DEFAULT_dispatchPlugin
Set to "undef" forces to switch off, or e.g. "Priority,1.0" to access the PriorizedDispatchPlugin
Setting it to 'null' (which is the default) lets the server choose the plugin
protected PropString dispatchPlugin
public boolean DEFAULT_stallOnPingTimeout
protected PropBoolean stallOnPingTimeout
protected java.lang.String nodeId
protected transient boolean fromPersistenceRecovery
private java.lang.Object callbackDriver
Constructor Detail |
---|
public AddressBase(Global glob, java.lang.String rootTag)
Method Detail |
---|
public abstract long getDefaultPingInterval()
public abstract int getDefaultRetries()
public abstract long getDefaultDelay()
public AddressBase getClone()
protected void initialize()
public void setPluginProperty(java.lang.String key, java.lang.String value)
Setting a property here forces the setting in the plugin, it
has precedence over any environment, xmlBlaster.properties or command line setting.
You typically use this method in your client code to overwrite settings,.
please check the protocol specific documentation about the supported settings.
key
- The property, e.g. "SOLingerTimeout" (WITHOUT any prefix like "plugin/socket/")
The searched property is depending on the type (here "socket")
and instance (here "connection") e.g. "plugin/socket/SOLingerTimeout"
and with higher precedence "dispatch/connection/plugin/socket/SOLingerTimeout"value
- The value, e.g. "10000"public void addClientProperty(ClientProperty clientProperty)
public void setPluginInfoParameters(java.util.Properties parameters)
public java.lang.String getEnvPrefix()
public boolean hasAttributeEnv(java.lang.String key)
public PropString getEnv(java.lang.String key, java.lang.String defaultValue)
key
- The property, e.g. "SOLingerTimeout" (WITHOUT any prefix like "plugin/socket/")
public PropInt getEnv(java.lang.String key, int defaultValue)
key
- The property, e.g. "SOLingerTimeout" (WITHOUT any prefix like "plugin/socket/")
public PropLong getEnv(java.lang.String key, long defaultValue)
key
- The property, e.g. "SOLingerTimeout" (WITHOUT any prefix like "plugin/socket/")
public PropBoolean getEnv(java.lang.String key, boolean defaultValue)
key
- The property, e.g. "SOLingerTimeout" (WITHOUT any prefix like "plugin/socket/")
public java.lang.String getEnvLookupKey(java.lang.String key)
public final java.lang.String getName()
public final boolean isSameAddress(AddressBase other)
private final void setRootTag(java.lang.String rootTag)
public java.lang.String getSettings()
public final void setType(java.lang.String type)
type
- The protocol type, e.g. "IOR", "EMAIL", "XMLRPC"
If you pass null the value is reset to its default settingpublic final void setVersion(java.lang.String version)
version
- The protocol version, e.g. "1.0"public java.lang.String getLogId()
public final void setBootstrapHostname(java.lang.String host)
NOTE:
This bootstrapping bootstrapPort is currently only used by the CORBA plugin.
To set other protocols try e.g.:
String[] args = { "-protocol", "SOCKET", "-dispatch/connection/plugin/socket/hostname", "myHost", "-dispatch/connection/plugin/socket/port", "7666", "-dispatch/connection/plugin/socket/localHostname", "myHost", // optional "-dispatch/connection/plugin/socket/localPort", "8888" }; // optional glob.init(args);
host
- An IP or DNSpublic final void setDefaultBootstrapHostname(java.lang.String host)
public boolean hasBootstrapHostname()
public final java.lang.String getBootstrapHostname()
public final java.lang.String getBootstrapUrl()
public final void setBootstrapPort(int bootstrapPort)
NOTE:
This bootstrapping bootstrapPort is currently only used by the CORBA plugin.
To set other protocols try e.g.:
String[] args = { "-protocol", "SOCKET", "-dispatch/connection/plugin/socket/hostname", "myHost", "-dispatch/connection/plugin/socket/port", "7666", "-dispatch/connection/plugin/socket/localHostname", "myHost", // optional "-dispatch/connection/plugin/socket/localPort", "8888" }; // optional glob.init(args);
public final int getBootstrapPort()
public final void setDefaultBootstrapPort(int defaultBootstrapPort)
If the bootstrapPort was changed by environment setting, this setting has precedence over the given defaultPort and nothing happens.
This is used by the protocol plugins which all have different defaults
public final void setRawAddress(java.lang.String rawAddress)
If you set an address here you need to set it compatible to the
protocol from getType().
For XmlRpc it looks typically like http://myServer:8080
for CORBA like IOR:00005395.... and
for SOCKET like socket://128.56.44.12:7608
Setting the address here has precedence over any environment settings like -dispatch/connection/plugin/socket/port 7666 on command line or
String[] args = { "-protocol", "SOCKET", "-dispatch/connection/plugin/socket/hostname", "myHost", "-dispatch/connection/plugin/socket/port", "7666", "-dispatch/connection/plugin/socket/localHostname", "myHost", // optional "-dispatch/connection/plugin/socket/localPort", "8888" }; // optional glob.init(args);
rawAddress
- The address specific for the protocol, e.g. "et@mars.univers" for EMAILpublic final java.lang.String getRawAddress()
public final void setCallbackDriver(java.lang.Object callbackDriver)
public final java.lang.Object getCallbackDriver()
public final java.lang.String getType()
public final java.lang.String getVersion()
public final java.lang.String getOnExhaust()
public final boolean getOnExhaustKillSession()
public final long getCollectTime()
public void setCollectTime(long collectTime)
The
- time to collect in millisecondspublic int getBurstModeMaxEntries()
public void setBurstModeMaxEntries(int burstModeMaxEntries)
public long getBurstModeMaxBytes()
public void setBurstModeMaxBytes(long burstModeMaxBytes)
public final long getPingInterval()
public void setPingInterval(long pingInterval)
pingInterval
- The pause time between pings in millispublic final int getRetries()
public void setRetries(int retries)
-1
- forever, 0 no retry, > 0 number of retriespublic final long getDelay()
public void setDelay(long delay)
public final boolean oneway()
public void setOneway(boolean oneway)
oneway
- false is defaultpublic void setDispatcherActive(boolean dispatcherActive)
dispatcherActive
- public boolean isDispatcherActive()
public void setPtpAllowed(boolean ptpAllowed)
Set
- if we accept point to point messagespublic final boolean isPtpAllowed()
public void setCompressType(java.lang.String compressType)
public final java.lang.String getSecretSessionId()
public void setSecretSessionId(java.lang.String sessionId)
public final java.lang.String getCompressType()
public long getMinSize()
public void setMinSize(long minSize)
public void setDispatchPlugin(java.lang.String dispatchPlugin)
Set to "undef" to switch off, or to e.g. "Priority,1.0" to access the PriorizedDispatchPlugin
This overwrites the xmlBlaster.properties default setting e.g.:
DispatchPlugin[Priority][1.0]=org.xmlBlaster.util.dispatch.plugins.prio.PriorizedDispatchPlugin DispatchPlugin[SlowMotion][1.0]=org.xmlBlaster.util.dispatch.plugins.motion.SlowMotion DispatchPlugin/defaultPlugin=Priority,1.0
public java.lang.String getDispatchPlugin()
public final boolean isStallOnPingTimeout()
public final void setStallOnPingTimeout(boolean stallOnPingTimeout)
public final void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.StringBuffer character, org.xml.sax.Attributes attrs)
public final void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.StringBuffer character)
public final java.lang.String toXml()
public final java.lang.String toXml(java.lang.String extraOffset)
extraOffset
- indenting of tags for nice output
public java.lang.String usage()
public SessionName getSessionName()
public void setSessionName(SessionName sessionName)
public void shutdown()
public boolean isFromPersistenceRecovery()
public void setFromPersistenceRecovery(boolean fromPersistenceRecovery)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |