facebook

MyEclipse and jboss annotation

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #239898 Reply

    gzhuye
    Member

    Hi,

    Who knows how to use jboss annotation ? when I got samples from jboss tutorial, and populate to MyEclipse, errors displayed with them.

    One sample as below:

    package org.jboss.tutorial.timer.bean;
    
    import java.util.Date;
    import javax.annotation.Resource;
    import javax.ejb.Remote;
    import javax.ejb.SessionContext;
    import javax.ejb.Stateless;
    import javax.ejb.Timeout;
    import javax.ejb.Timer;
    
    @Stateless
    @Remote(ExampleTimer.class)
    public class ExampleTimerBean implements ExampleTimer
    {
       private @Resource SessionContext ctx;
    
       public void scheduleTimer(long milliseconds)
       {
          ctx.getTimerService().createTimer(new Date(new Date().getTime() + milliseconds), "Hello World");
       }
    
       @Timeout
       public void timeoutHandler(Timer timer)
       {
          System.out.println("---------------------");
          System.out.println("* Received Timer event: " + timer.getInfo());
          System.out.println("---------------------");
    
          timer.cancel();
       }
    }
    

    Thanks in advance

    Paul

    #239981 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev.

    Annotations are a Java 5 construct, You will need Eclipse 3.1 or later for full Java 5 support. the Java editor is provided by the JDT from the Eclipse team, taht is why this isn’t really a ME question.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: MyEclipse and jboss annotation

You must be logged in to post in the forum log in