Package org.apache.axis2.service
Interface Lifecycle
public interface Lifecycle
The Lifecycle interface should be implemented by your back-end service
class if you wish to be notified of creation and cleanup by the Axis2
framework.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy(ServiceContext context) destroy() is called when Axis2 decides that it is finished with a particular instance of the back-end service class.voidinit(ServiceContext context) init() is called when a new instance of the implementing class has been created.
-
Method Details
-
init
init() is called when a new instance of the implementing class has been created. This occurs in sync with session/ServiceContext creation. This method gives classes a chance to do any setup work (grab resources, establish connections, etc) before they are invoked by a service request.- Parameters:
context- the active ServiceContext- Throws:
AxisFault- if something goes wrong. Throwing a fault here will result in either failed deployment (for application-scoped services) or failed requests.
-
destroy
destroy() is called when Axis2 decides that it is finished with a particular instance of the back-end service class. It allows classes to clean up resources.- Parameters:
context- the active ServiceContext
-