org.jdiameter.client.impl
Class StackImpl

java.lang.Object
  extended by org.jdiameter.client.impl.StackImpl
All Implemented Interfaces:
org.jdiameter.api.Stack, org.jdiameter.api.Wrapper, IContainer, StackImplMBean
Direct Known Subclasses:
StackImpl

public class StackImpl
extends java.lang.Object
implements IContainer, StackImplMBean

Use stack extension point


Field Summary
protected  IAssembler assembler
           
protected  org.jdiameter.api.Configuration config
           
protected  java.util.concurrent.locks.Lock lock
           
protected  java.util.logging.Logger logger
           
protected  IPeerTable peerManager
           
protected  java.util.concurrent.ScheduledExecutorService scheduledFacility
          Use for processing request time-out tasks (for all active peers)
protected  StackState state
           
 
Constructor Summary
StackImpl()
           
 
Method Summary
 void addSessionListener(java.lang.String sessionId, org.jdiameter.api.NetworkReqListener listener)
          Add session listener
 java.lang.String configuration()
          Return string representation of stack instanceconfiguration
 void destroy()
           
 IAssembler getAssemblerFacility()
          Return root IOC
 org.jdiameter.api.Configuration getConfiguration()
          Return configuration instance
 java.util.logging.Logger getLogger()
           
 org.jdiameter.api.MetaData getMetaData()
           
 java.lang.String getRootLogLevel()
          Return root(Stack) log level value
 java.util.concurrent.ScheduledExecutorService getScheduledFacility()
          Return common Scheduled Executor Service
 org.jdiameter.api.SessionFactory getSessionFactory()
           
 StackState getState()
          Return state of stack
 org.jdiameter.api.SessionFactory init(org.jdiameter.api.Configuration config)
           
 boolean isActive()
          Return true if stack is started
 boolean isWrapperFor(java.lang.Class<?> aClass)
           
 java.lang.String metaData()
          Return string representation of stack instance metadata
 java.lang.String peerDescription(java.lang.String name)
          Reurn description (include state) of defined peer
 java.lang.String peerList()
          Return list of peer
 void removeSessionListener(java.lang.String sessionId)
          Remove session event listener by sessionId
 void sendMessage(IMessage message)
          Send messahe
 void setRootLogLevel(java.lang.String level)
          Set log level on root(Stack) logger
 void start()
          Run startd procedure
 void start(org.jdiameter.api.Mode mode, long timeOut, java.util.concurrent.TimeUnit timeUnit)
           
 void stop()
          Run stop procedure
 void stop(long timeOut, java.util.concurrent.TimeUnit timeUnit)
           
<T> T
unwrap(java.lang.Class<T> aClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected java.util.logging.Logger logger

assembler

protected IAssembler assembler

config

protected org.jdiameter.api.Configuration config

peerManager

protected IPeerTable peerManager

state

protected StackState state

lock

protected java.util.concurrent.locks.Lock lock

scheduledFacility

protected java.util.concurrent.ScheduledExecutorService scheduledFacility
Use for processing request time-out tasks (for all active peers)

Constructor Detail

StackImpl

public StackImpl()
Method Detail

init

public org.jdiameter.api.SessionFactory init(org.jdiameter.api.Configuration config)
                                      throws org.jdiameter.api.IllegalDiameterStateException,
                                             org.jdiameter.api.InternalException
Specified by:
init in interface org.jdiameter.api.Stack
Throws:
org.jdiameter.api.IllegalDiameterStateException
org.jdiameter.api.InternalException

getSessionFactory

public org.jdiameter.api.SessionFactory getSessionFactory()
                                                   throws org.jdiameter.api.IllegalDiameterStateException
Specified by:
getSessionFactory in interface org.jdiameter.api.Stack
Throws:
org.jdiameter.api.IllegalDiameterStateException

start

public void start()
           throws org.jdiameter.api.IllegalDiameterStateException,
                  org.jdiameter.api.InternalException
Description copied from interface: StackImplMBean
Run startd procedure

Specified by:
start in interface org.jdiameter.api.Stack
Specified by:
start in interface StackImplMBean
Throws:
org.jdiameter.api.IllegalDiameterStateException
org.jdiameter.api.InternalException

start

public void start(org.jdiameter.api.Mode mode,
                  long timeOut,
                  java.util.concurrent.TimeUnit timeUnit)
           throws org.jdiameter.api.IllegalDiameterStateException,
                  org.jdiameter.api.InternalException
Specified by:
start in interface org.jdiameter.api.Stack
Throws:
org.jdiameter.api.IllegalDiameterStateException
org.jdiameter.api.InternalException

stop

public void stop(long timeOut,
                 java.util.concurrent.TimeUnit timeUnit)
          throws org.jdiameter.api.IllegalDiameterStateException,
                 org.jdiameter.api.InternalException
Specified by:
stop in interface org.jdiameter.api.Stack
Throws:
org.jdiameter.api.IllegalDiameterStateException
org.jdiameter.api.InternalException

destroy

public void destroy()
Specified by:
destroy in interface org.jdiameter.api.Stack

isActive

public boolean isActive()
Description copied from interface: StackImplMBean
Return true if stack is started

Specified by:
isActive in interface org.jdiameter.api.Stack
Specified by:
isActive in interface StackImplMBean
Returns:
true if stack is started

getLogger

public java.util.logging.Logger getLogger()
Specified by:
getLogger in interface org.jdiameter.api.Stack

getMetaData

public org.jdiameter.api.MetaData getMetaData()
Specified by:
getMetaData in interface org.jdiameter.api.Stack

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> aClass)
                     throws org.jdiameter.api.InternalException
Specified by:
isWrapperFor in interface org.jdiameter.api.Wrapper
Throws:
org.jdiameter.api.InternalException

unwrap

public <T> T unwrap(java.lang.Class<T> aClass)
         throws org.jdiameter.api.InternalException
Specified by:
unwrap in interface org.jdiameter.api.Wrapper
Throws:
org.jdiameter.api.InternalException

getState

public StackState getState()
Description copied from interface: IContainer
Return state of stack

Specified by:
getState in interface IContainer
Returns:
Return state of stack

getConfiguration

public org.jdiameter.api.Configuration getConfiguration()
Description copied from interface: IContainer
Return configuration instance

Specified by:
getConfiguration in interface IContainer
Returns:
configuration instance

getAssemblerFacility

public IAssembler getAssemblerFacility()
Description copied from interface: IContainer
Return root IOC

Specified by:
getAssemblerFacility in interface IContainer
Returns:
root IOC

sendMessage

public void sendMessage(IMessage message)
                 throws org.jdiameter.api.RouteException,
                        org.jdiameter.api.AvpDataException,
                        org.jdiameter.api.IllegalDiameterStateException,
                        java.io.IOException
Description copied from interface: IContainer
Send messahe

Specified by:
sendMessage in interface IContainer
Parameters:
message - session instance
Throws:
org.jdiameter.api.RouteException
org.jdiameter.api.AvpDataException
org.jdiameter.api.IllegalDiameterStateException
java.io.IOException

addSessionListener

public void addSessionListener(java.lang.String sessionId,
                               org.jdiameter.api.NetworkReqListener listener)
Description copied from interface: IContainer
Add session listener

Specified by:
addSessionListener in interface IContainer
Parameters:
sessionId - session id
listener - listener instance

removeSessionListener

public void removeSessionListener(java.lang.String sessionId)
Description copied from interface: IContainer
Remove session event listener by sessionId

Specified by:
removeSessionListener in interface IContainer
Parameters:
sessionId - session identifier

getScheduledFacility

public java.util.concurrent.ScheduledExecutorService getScheduledFacility()
Description copied from interface: IContainer
Return common Scheduled Executor Service

Specified by:
getScheduledFacility in interface IContainer
Returns:
common Scheduled Executor Service

getRootLogLevel

public java.lang.String getRootLogLevel()
Description copied from interface: StackImplMBean
Return root(Stack) log level value

Specified by:
getRootLogLevel in interface StackImplMBean
Returns:
root(Stack) log level value

setRootLogLevel

public void setRootLogLevel(java.lang.String level)
Description copied from interface: StackImplMBean
Set log level on root(Stack) logger

Specified by:
setRootLogLevel in interface StackImplMBean
Parameters:
level - llevel name

configuration

public java.lang.String configuration()
Description copied from interface: StackImplMBean
Return string representation of stack instanceconfiguration

Specified by:
configuration in interface StackImplMBean
Returns:
string representation of stack instance configuration

metaData

public java.lang.String metaData()
Description copied from interface: StackImplMBean
Return string representation of stack instance metadata

Specified by:
metaData in interface StackImplMBean
Returns:
string representation of stack instance metadata

peerDescription

public java.lang.String peerDescription(java.lang.String name)
Description copied from interface: StackImplMBean
Reurn description (include state) of defined peer

Specified by:
peerDescription in interface StackImplMBean
Parameters:
name - peer host name
Returns:
description of defined peer

peerList

public java.lang.String peerList()
Description copied from interface: StackImplMBean
Return list of peer

Specified by:
peerList in interface StackImplMBean
Returns:
list of peer

stop

public void stop()
Description copied from interface: StackImplMBean
Run stop procedure

Specified by:
stop in interface StackImplMBean


Copyright © 2008. All Rights Reserved.