org.jboss.ejb3.timerservice.naming
Class TimerServiceBinder

java.lang.Object
  extended by org.jboss.ejb3.timerservice.naming.TimerServiceBinder

public class TimerServiceBinder
extends java.lang.Object

Responsible for binding TimerService into JNDI at a internal JNDI name.

The internal JNDI name is meant to be used by EJB3 internal implementation and isn't meant to be used by user deployments. User deployments are expected to use the java:comp/TimerService JNDI name, as dictated by EJB3 spec. For further details of accessing TimerService in user deployments, refer the EJB3.0/EJB3.1 spec

The default JNDI name to which the TimerService is bound is java:internal/TimerService. This can be overriden by using the TimerServiceBinder(String, Context)

Version:
$Revision: $
Author:
Jaikiran Pai

Constructor Summary
TimerServiceBinder()
          Constructs TimerServiceBinder
TimerServiceBinder(javax.naming.Context ctx)
          Constructs a TimerServiceBinder
TimerServiceBinder(java.lang.String jndiName)
          Constructs a TimerServiceBinder
TimerServiceBinder(java.lang.String jndiName, javax.naming.Context ctx)
          Constructs a TimerServiceBinder
 
Method Summary
 javax.naming.Context getContext()
          Returns the Context to which the TimerService is bound
 java.lang.String getTimerServiceJNDIName()
          Returns the jndi name to which the TimerService will be bound by this TimerServiceBinder
 void start()
          Binds the TimerService to jndiName under context
 void stop()
          Unbinds TimerService from jndiName under context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerServiceBinder

public TimerServiceBinder()
Constructs TimerServiceBinder

Instantiates a new InitialContext to bind the TimerService


TimerServiceBinder

public TimerServiceBinder(java.lang.String jndiName,
                          javax.naming.Context ctx)
Constructs a TimerServiceBinder

Parameters:
jndiName - The jndi name to which the TimerService should be bound
ctx - The naming context to which the TimerService should be bound
Throws:
java.lang.IllegalArgumentException - If either of jndiName or ctx is null

TimerServiceBinder

public TimerServiceBinder(java.lang.String jndiName)
Constructs a TimerServiceBinder

Parameters:
jndiName - The jndi name to which the TimerService is to be bound

TimerServiceBinder

public TimerServiceBinder(javax.naming.Context ctx)
Constructs a TimerServiceBinder

Parameters:
ctx - The naming context to which the TimerService has to be bound
Method Detail

getContext

public javax.naming.Context getContext()
Returns the Context to which the TimerService is bound

Returns:

getTimerServiceJNDIName

public java.lang.String getTimerServiceJNDIName()
Returns the jndi name to which the TimerService will be bound by this TimerServiceBinder

Returns:

start

public void start()
           throws javax.naming.NamingException
Binds the TimerService to jndiName under context

Throws:
javax.naming.NamingException - If there is any exception during the bind operation

stop

public void stop()
          throws javax.naming.NamingException
Unbinds TimerService from jndiName under context

Throws:
javax.naming.NamingException - If there is any exception during the bind operation


Copyright © 2010. All Rights Reserved.