You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by "Hensley, Richard" <Ri...@McKesson.com> on 2004/08/27 05:24:24 UTC

RegistryShutdownListener

I have a service that implements the RegistryShutdownListener, however I
don't see evidence in the debugger that the registryDidShutdown() method is
getting called. I do see the setController() dependency injector getting
called. I'm sure I missed something, but I'm not sure what.

here is the hivemodule.xml snip

    <service-point
     id="ControllerShutdown"
     interface="com.mckesson.lab.adept.ControllerShutdown">
        <invoke-factory>
            <construct
             class="com.mckesson.lab.adept.ControllerShutdownImpl">
                <set-service
                 property="controller"
                 service-id="com.mckesson.adept.Controller" />
            </construct>
        </invoke-factory>
    </service-point>

    <contribution
     configuration-id="hivemind.EagerLoad">
        <load
         service-id="ControllerShutdown" />
    </contribution>

And here is the class

public class ControllerShutdownImpl
        implements
            ControllerShutdown,
            RegistryShutdownListener {
   private Controller controller;
   public void registryDidShutdown() {
        System.out.println("Controller Shutdown " + controller.toString());
        this.controller.shutdown();
    }
    public void setController(Controller controller) {
        this.controller = controller;
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: RegistryShutdownListener

Posted by James Carman <ja...@carmanconsulting.com>.
The javadocs for the RegistryShutdownListener need to be updated then...

"A core service implementation that implements this interface will
automatically be registered for notifications"

-----Original Message-----
From: Howard Lewis Ship [mailto:hlship@gmail.com] 
Sent: Friday, August 27, 2004 8:30 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: RegistryShutdownListener

You have to use an <event-listener> element in within your
BuilderFactory <construct> parameter. The service-id should be
hivemind.ShutdownCoordinator.

On Thu, 26 Aug 2004 23:24:24 -0400, Hensley, Richard
<ri...@mckesson.com> wrote:
> I have a service that implements the RegistryShutdownListener, however I
> don't see evidence in the debugger that the registryDidShutdown() method
is
> getting called. I do see the setController() dependency injector getting
> called. I'm sure I missed something, but I'm not sure what.
> 
> here is the hivemodule.xml snip
> 
>     <service-point
>      id="ControllerShutdown"
>      interface="com.mckesson.lab.adept.ControllerShutdown">
>         <invoke-factory>
>             <construct
>              class="com.mckesson.lab.adept.ControllerShutdownImpl">
>                 <set-service
>                  property="controller"
>                  service-id="com.mckesson.adept.Controller" />
>             </construct>
>         </invoke-factory>
>     </service-point>
> 
>     <contribution
>      configuration-id="hivemind.EagerLoad">
>         <load
>          service-id="ControllerShutdown" />
>     </contribution>
> 
> And here is the class
> 
> public class ControllerShutdownImpl
>         implements
>             ControllerShutdown,
>             RegistryShutdownListener {
>    private Controller controller;
>    public void registryDidShutdown() {
>         System.out.println("Controller Shutdown " +
controller.toString());
>         this.controller.shutdown();
>     }
>     public void setController(Controller controller) {
>         this.controller = controller;
>     }
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: RegistryShutdownListener

Posted by Howard Lewis Ship <hl...@gmail.com>.
You have to use an <event-listener> element in within your
BuilderFactory <construct> parameter. The service-id should be
hivemind.ShutdownCoordinator.

On Thu, 26 Aug 2004 23:24:24 -0400, Hensley, Richard
<ri...@mckesson.com> wrote:
> I have a service that implements the RegistryShutdownListener, however I
> don't see evidence in the debugger that the registryDidShutdown() method is
> getting called. I do see the setController() dependency injector getting
> called. I'm sure I missed something, but I'm not sure what.
> 
> here is the hivemodule.xml snip
> 
>     <service-point
>      id="ControllerShutdown"
>      interface="com.mckesson.lab.adept.ControllerShutdown">
>         <invoke-factory>
>             <construct
>              class="com.mckesson.lab.adept.ControllerShutdownImpl">
>                 <set-service
>                  property="controller"
>                  service-id="com.mckesson.adept.Controller" />
>             </construct>
>         </invoke-factory>
>     </service-point>
> 
>     <contribution
>      configuration-id="hivemind.EagerLoad">
>         <load
>          service-id="ControllerShutdown" />
>     </contribution>
> 
> And here is the class
> 
> public class ControllerShutdownImpl
>         implements
>             ControllerShutdown,
>             RegistryShutdownListener {
>    private Controller controller;
>    public void registryDidShutdown() {
>         System.out.println("Controller Shutdown " + controller.toString());
>         this.controller.shutdown();
>     }
>     public void setController(Controller controller) {
>         this.controller = controller;
>     }
> }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org