consciouscode.seedling
Interface ServiceNode

All Known Subinterfaces:
BranchingBranch, BranchNode, EventfulBranch, GrowingBranch, RootNode
All Known Implementing Classes:
AbstractPeriodicTask, EmptyBranch, GenericBranch, MemoryMonitorTask, NodeIndex, ScopeManager, ScopeRoot, SeedlingServer, SeedlingServletContextHandler, ShutdownNode, StandardBranch, StandardRoot, TestRunnerNode

public interface ServiceNode

Represents Seedling nodes that require special processing to startup, beyond the basic property assignments that all nodes receive.


Method Summary
 void startService()
          Starts a Seedling service.
 void stopService()
          Stops a Seedling service.
 

Method Detail

startService

void startService()
                  throws Exception
Starts a Seedling service. This is called by the Seedling runtime after the node has been installed and all properties have been set to their configured values. Any exceptions thrown by an implementation of this method are handled by the Seedling. Instances of RuntimeException are propagated to the application, but any other kind of exception is wrapped in a ServiceException and rethrown.

Throws:
Exception

stopService

void stopService()
Stops a Seedling service. This is called by the Seedling runtime as the node is uninstalled, either explicitly or by the Seedling itself being stopped.

Implementations of this method must not do anything that may change the state of the parent Seedling. In particular, it cannot call any overload of the following methods: BranchNode.getNode(java.lang.String), BranchNode.getChild(java.lang.String), GrowingBranch.installChild(java.lang.String, java.lang.Object), GrowingBranch.uninstallChild(java.lang.String).

Furthermore, this method may be called from within a JVM shutdown hook, which implies that it must work promptly and carefully.

See Also:
Runtime.addShutdownHook(java.lang.Thread)


Copyright © 2001–2012 Todd V. Jonker. All Rights Reserved.