hi,

in your case i'd do somehing like this:

public DataService buildDataService(RegistryShutdownHub hub) 
{
        DataService x = new DataServiceImpl();
        // if DataServiceImpl needs some DI too
                // inject ObjectLocator objectLocator
        // x = objectLocator.proxy(DataService.class, 
DataServiceImpl.class)
 
        hub.addRegistryShutdownListener(x);
        return x;
}




eduardo cavalcanti <[EMAIL PROTECTED]> 
18.06.2008 06:23
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
configuring a service for shutdown notification








Hi,
I have defined a service in AppModule:
    public static void bind(ServiceBinder binder)
    {
     binder.bind(DataService.class, DataServiceImpl.class);
...
It it uses db4o. The db file is open, assigned to a façade object, and by
the end a close() method must be issued, in order to restart the
application. If not a file locked exception is raised on app restart.
The DataServiceImpl class implements the RegistryShutdownListener 
interface.
I guess this is the right thing to do. Please correct if I'm wrong.
Then I have coded:
public void registryDidShutdown() {
 db.close();
 }
I guess the next step should be call addRegistryShutdownListener() on some
RegistryShutdownHub instance. Correct? How to do this.
Does Tapestry provide an instance of it or do I have to create one?

Thank you.
-- 
View this message in context: 
http://www.nabble.com/configuring-a-service-for-shutdown-notification-tp17959487p17959487.html

Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to