org.jdiameter.api
Interface Stack

All Superinterfaces:
Wrapper

public interface Stack
extends Wrapper

The interface that every stack class must implement. The Java Diameter framework allows for multiple database stacks. Each stack should supply a class that implements the Stack interface. The StackManager will try to load as many stacks. It is strongly recommended that each Stack class should be small and standalone. When a Stack class is loaded, it should create an instance of itself and register it with the StackManager. This means that a user can load and register a stack by calling Class.forName("org.jdiameter.impl.Stack") Wrapper interface allows adapt message to any driver vendor specific interface
Life cycle state machine for stack

Stack must supported following wrapper classes: - Client API : PeerManager - Server API : PeerManager, OverloadManager (Network, PeerManagerWrapper is optional)

Version:
1.5.1 Final

Method Summary
 void destroy()
          Destroy any resource append to this instacne of stack
 java.util.logging.Logger getLogger()
          Return logger instance.
 MetaData getMetaData()
           
 SessionFactory getSessionFactory()
          Return SessionFactory instance
 SessionFactory init(Configuration config)
          Configuration stack and allocation system resources.
 boolean isActive()
           
 void start()
          Start activity of stack (Thread and Network connections), not waiting swith ANY peer to OKEY state
 void start(Mode mode, long timeout, java.util.concurrent.TimeUnit unit)
          Start activity of stack (Thread and Network connections), waiting specified wait time swith peers to OKEY state.
 void stop(long timeout, java.util.concurrent.TimeUnit unit)
          Stop any activity of stack (Thread and Network connections), waiting if necessary up to the specified wait time swith peers to DOWN state.
 
Methods inherited from interface org.jdiameter.api.Wrapper
isWrapperFor, unwrap
 

Method Detail

init

SessionFactory init(Configuration config)
                    throws IllegalDiameterStateException,
                           InternalException
Configuration stack and allocation system resources.

Parameters:
config - Object with configuration parameters
Returns:
instance of session factory (DataSource equals)
Throws:
IllegalDiameterStateException - if a stack already configured or destroed
InternalException - if a stack can not processing initial procedure

start

void start()
           throws IllegalDiameterStateException,
                  InternalException
Start activity of stack (Thread and Network connections), not waiting swith ANY peer to OKEY state

Throws:
IllegalDiameterStateException - if a stack is not confgured or stopped
InternalException - if a stack can not processing start procedure

start

void start(Mode mode,
           long timeout,
           java.util.concurrent.TimeUnit unit)
           throws IllegalDiameterStateException,
                  InternalException
Start activity of stack (Thread and Network connections), waiting specified wait time swith peers to OKEY state.

Parameters:
mode - specified type of wait procedure
timeout - how long to wait before giving up, in units of unit
unit - a TimeUnit determining how to interpret the timeout parameter
Throws:
IllegalDiameterStateException - if a stack is not confgured or stopped
InternalException - if a stack can not processing start procedure

stop

void stop(long timeout,
          java.util.concurrent.TimeUnit unit)
          throws IllegalDiameterStateException,
                 InternalException
Stop any activity of stack (Thread and Network connections), waiting if necessary up to the specified wait time swith peers to DOWN state.

Parameters:
timeout - how long to wait before giving up, in units of unit
unit - a TimeUnit determining how to interpret the timeout parameter
Throws:
IllegalDiameterStateException - if a stack is not started
InternalException - if a stack can not processing start procedure

destroy

void destroy()
Destroy any resource append to this instacne of stack


isActive

boolean isActive()
Returns:
true is stack is running.

getLogger

java.util.logging.Logger getLogger()
Return logger instance. You can set your logger handler and processing logger alarms in application.

Returns:
logger interface

getSessionFactory

SessionFactory getSessionFactory()
                                 throws IllegalDiameterStateException
Return SessionFactory instance

Returns:
SessionFactory instance
Throws:
IllegalDiameterStateException - if stack is not configure

getMetaData

MetaData getMetaData()
Returns:
stack meta information


Copyright © 2010. All Rights Reserved.