Package org.jboss.test.timer.interfaces

Examples of org.jboss.test.timer.interfaces.TimerSLSBHome.create()


      //
      try
      {
         InitialContext ctx = new InitialContext();
         TimerSLSBHome home = (TimerSLSBHome) ctx.lookup("java:/comp/env/ejb/TimerSLSBHome");
         TimerSLSB bean = home.create();
         handle = bean.startTimer(60000);
      }
      catch(Exception e)
      {
         throw new ServletException(e);
View Full Code Here


   {
      try
      {
         InitialContext ctx = new InitialContext();
         TimerSLSBHome home = (TimerSLSBHome) ctx.lookup("java:/comp/env/ejb/TimerSLSBHome");
         TimerSLSB bean = home.create();
         int timeoutCount = bean.getTimeoutCount(handle);
         Date nextTimeout = bean.getNextTimeout(handle);
         long timeRemaining = bean.getTimeRemaining(handle);
         PrintWriter pw = response.getWriter();
         pw.println("<html><head><title>InitTimerServlet</title></head><body>");
View Full Code Here

   public void testSecuredStatelessSessionBeanTimer()
      throws Exception
   {
      login();
      TimerSLSBHome home = (TimerSLSBHome) getEJBHome(TimerSLSBHome.SECURED_JNDI_NAME);
      TimerSLSB bean = home.create();
      byte[] handle = bean.startTimer(SHORT_PERIOD);
      // Sleep for 20x the timer interval and expect at least 10 events
      Thread.sleep(20 * SHORT_PERIOD);
      int count = bean.getTimeoutCount(handle);
      bean.stopTimer(handle);
View Full Code Here

   public void testSecuredStatelessSessionBeanSingleTimer()
      throws Exception
   {
      login();
      TimerSLSBHome home = (TimerSLSBHome) getEJBHome(TimerSLSBHome.SECURED_JNDI_NAME);
      TimerSLSB bean = home.create();
      byte[] handle = bean.startSingleTimer(SHORT_PERIOD);
      Thread.sleep(5 * SHORT_PERIOD);
      int count = bean.getTimeoutCount(handle);
      assertTrue("Timeout was expected to be called only once but was called: "
         + count + " times",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.