package org.ow2.jonas.ws.axis2.test.handlers;


import javax.ejb.EJB;
import javax.xml.ws.handler.LogicalMessageContext;
import javax.xml.ws.handler.MessageContext;

import org.ow2.jonas.ws.axis2.test.ejb3.Hello;

public class GreeterLogicalHandler implements javax.xml.ws.handler.LogicalHandler<LogicalMessageContext> {

    //@Resource(name = "greeting")
    //private String greeting;

   @EJB(name="ejb3.Hello")
   Hello hello;

    public void close(final MessageContext arg0) {
        // TODO Auto-generated method stub
        System.out.println("CLOSE in LogicalHandler");
    }

    public boolean handleFault(final LogicalMessageContext arg0) {
        // TODO Auto-generated method stub
        return true;
    }

    public boolean handleMessage(final LogicalMessageContext arg0) {

        // TODO Auto-generated method stub
        System.out.println("GREATERLogicalHandler HandleMessage");
        //System.out.println(greeting);
        hello.sayHello("hello world");

        return true;
    }
}


