public final class StackManager extends Object
The basic service for managing a set of Diameter stacks.
As part of its initialization, the DriverManager class will
attempt to load the stacks classes referenced in the "diameter.drivers"
system property. This allows a user to customize the Diameter Drivers
used by their applications. For example in your
~/.hotjava/properties file you might specify:
diameter.drivers=foo.bah.Stack:wombat.diameter.Stack
A program can also explicitly load Diameter stacks at any time. For
example, the my.diameter.Stack is loaded with the following statement:
Class.forName("my.diameter.Stack");
When the method getSession is called,
the StackManager will attempt to
locate a suitable stack from amongst those loaded at
initialization and those loaded explicitly using the same classloader
as the current applet or application.
| Modifier and Type | Method and Description |
|---|---|
static void |
deregisterStack(Stack stack)
Drops a driver from the
DiameterManager's list. |
static PrintWriter |
getLogWriter()
Retrieves the log writer.
|
static Stack |
getStack(String className)
Attempts to locate a stack.
|
static Enumeration<Stack> |
getStacks()
Retrieves an Enumeration with all of the currently loaded Diameter stacks
to which the current caller has access.
|
static void |
println(String message) |
static void |
registerStack(Stack stack)
Registers the given stack with the
ScoketManager. |
static void |
setLogWriter(PrintWriter out)
Sets the logging/tracing
PrintWriter object
that is used by the StackManager and all drivers. |
public static PrintWriter getLogWriter()
getLogWriter and setLogWriter
methods should be used instead
of the get/setlogStream methods, which are deprecated.java.io.PrintWriter objectsetLogWriter(java.io.PrintWriter)public static void setLogWriter(PrintWriter out)
PrintWriter object
that is used by the StackManager and all drivers.
There is a minor versioning problem created by the introduction
of the method setLogWriter. The
method setLogWriter cannot create a PrintStream object
that will be returned by getLogStream
out - the new logging/tracing PrintStream object;
null to disable logging and tracingSecurityException - if a security manager exists and its
checkPermission method denies
setting the log writerpublic static Stack getStack(String className) throws InternalException
StackManager attempts to select an appropriate stack from
the set of registered Diameter stacks.className - class name of stackInternalException - if a manager has internal errorpublic static void registerStack(Stack stack) throws InternalException
ScoketManager.
A newly-loaded stack class should call
the method registerStack to make itself
known to the StackManager.stack - the new Diameter Stack that is to be registered with the
StackManagerInternalException - if a manager has internal errorpublic static void deregisterStack(Stack stack) throws InternalException
DiameterManager's list. Applets can only
deregister stacks from their own classloaders.stack - the Diameter stack to dropInternalException - if a manager has internal errorpublic static Enumeration<Stack> getStacks()
Note: The classname of a stack can be found using
d.getClass().getName()
public static void println(String message)
Copyright © 2016. All Rights Reserved.