- All Known Subinterfaces:
- EntityContext, MessageDrivenContext, SessionContext
- See Also:
- Top Examples, Source Code
public Identity getCallerIdentity()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Principal getCallerPrincipal()
- See Also:
- IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public EJBHome getEJBHome()
- See Also:
- IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[472]Create a timer that will go off 30 days from now in EJB 2.1
By Anonymous on 2003/10/24 13:59:08 Rate
//Timer service in EJB 2.1
// Create a Calandar object that represents the time 27 days from now.
Calendar time = Calendar.getInstance ( ) ; // the current time.
time.add ( Calendar.DATE, 27 ) ; // add 27 days to the current time.
Date date = time.getTime ( ) ;
// Create a timer that will go off 30 days from now.
EJBContext ejbContext = // ...: get EJBContext object from somewhere.
TimerService timerService = ejbContext.getTimerService ( ) ;
timerService.createTimer ( date, null ) ;
//getEJBHome
[473]Cancel all timers
By Anonymous on 2003/10/24 13:59:28 Rate
//Timer service in EJB 2.1
private void cancelTimer ( ) {
TimerService timerService = ejbCntxt.getTimerService ( ) ;
Iterator timers = timerService.getTimers ( ) .iterator ( ) ;
if ( timers.hasNext ( ) ) {
Timer timer = ( Timer ) timers.next ( ) ;
timer.cancel ( ) ;
}
}
//getEJBHome
public EJBLocalHome getEJBLocalHome()
- See Also:
- IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Properties getEnvironment()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean getRollbackOnly()
throws IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public TimerService getTimerService()
throws IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public UserTransaction getUserTransaction()
throws IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isCallerInRole(String roleName)
- See Also:
- IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isCallerInRole(Identity role)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setRollbackOnly()
throws IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples