#set( $package = $generated.packageName ) #set( $serviceName = $generated.serviceName ) #set( $implements = $generated.resourceImplements ) #set( $propDoc = $generated.propertyDocumentName ) #set( $namespaceSetConstantName = $generated.namespaceSetConstantName ) #set( $namespaceVersionHolder = $generated.namespaceVersionHolder ) package $package; import org.apache.ws.addressing.EndpointReference; /** * An abstract base class for the $serviceName resource. *

* ***** WARNING ***** * This class is generated by Wsdl2Java and is NOT meant to be modified. * It will be overwritten by subsequent runs of Wsdl2Java. */ public abstract class Abstract${serviceName}Resource #if($implements) implements ${implements} #end { #if( $namespaceVersionHolder ) $namespaceVersionHolder #end /** * The resource ID of the instance. */ protected String m_id; /** The EndpointReference for this resource **/ protected EndpointReference m_endpointReference; #if($generated.hasProperties) /** * The set of properties associated with this resource. */ protected org.apache.ws.resource.properties.ResourcePropertySet m_propSet; #end /** * A list of termination listeners to be notified when the resource is terminated. */ private java.util.List m_terminationListeners = new java.util.ArrayList(); /** * DOCUMENT_ME * * @param id DOCUMENT_ME */ public void setID( Object id ) { if ( m_id != null ) { throw new IllegalStateException( "This resource's ID has already been set." ); } try { m_id = (String) id; } catch ( ClassCastException cce ) { throw new IllegalArgumentException( "Specified ID is not a String." ); } } /** * DOCUMENT_ME * * @param listener DOCUMENT_ME */ public void addTerminationListener( org.apache.ws.resource.lifetime.ResourceTerminationListener listener) { m_terminationListeners.add(listener); } /** * DOCUMENT_ME * * @return DOCUMENT_ME */ public Object getID() { return m_id; } public void destroy() { org.apache.ws.resource.lifetime.ResourceTerminationEvent rte = new org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl(getID(),"Resource Destroyed"); for (int i = 0; i < m_terminationListeners.size(); i++) { org.apache.ws.resource.lifetime.ResourceTerminationListener resourceTerminationEventListener = (org.apache.ws.resource.lifetime.ResourceTerminationListener) m_terminationListeners.get(i); resourceTerminationEventListener.terminationOccurred(rte); } return; } public void init() { #if($generated.hasProperties) $propDoc propsDoc = ${propDoc}.Factory.newInstance(); m_propSet = new org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet( propsDoc ); #end #foreach( $includeFile in $generated.AbstractResourceInitIncludeLocations ) #parse( $includeFile ) #end } /** * Returns the EndpointReference associated with this Resource. * * @return The Resource's EndpointReference or null if the EndpointReference has not been set. * * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl) */ public EndpointReference getEndpointReference() { return m_endpointReference; } /** * Sets the EndpointReference associated with this Resource. * * @param epr the Resource's EndpointReference * * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl) */ public void setEndpointReference(EndpointReference epr) { m_endpointReference = epr; } /** * @see org.apache.ws.resource.Resource#getNamespaceSet() */ public org.apache.ws.resource.NamespaceVersionHolder getNamespaceSet() { return $namespaceSetConstantName; } #foreach( $includeFile in $generated.ResourceIncludeFiles ) #include( $includeFile ) #end }