Source code: com/dell/wsdm/demos/interop/x2005/x04/AbstractIpmiserverResource.java
1 package com.dell.wsdm.demos.interop.x2005.x04;
2
3 import org.apache.ws.addressing.EndpointReference;
4
5 /**
6 * An abstract Ipmiserver WS-Resource.
7 * <p/>
8 * NOTE: This class is generated and is NOT meant to be modified.
9 */
10 public abstract class AbstractIpmiserverResource implements org.apache.ws.resource.PropertiesResource, org.apache.ws.notification.base.NotificationProducerResource
11 {
12
13 /**
14 * The resource ID of the instance.
15 */
16 protected String m_id;
17
18 /**
19 * The EndpointReference for this resource *
20 */
21 protected EndpointReference m_endpointReference;
22
23 /**
24 * The set of properties associated with this resource.
25 */
26 protected org.apache.ws.resource.properties.ResourcePropertySet m_propSet;
27
28
29 /**
30 * A list of termination listeners to be notified when the resource is terminated.
31 */
32 private java.util.List m_terminationListeners = new java.util.ArrayList();
33
34
35 /**
36 * DOCUMENT_ME
37 *
38 * @param id DOCUMENT_ME
39 */
40 public void setID(Object id)
41 {
42 if (m_id != null)
43 {
44 throw new IllegalStateException("This resource's ID has already been set.");
45 }
46
47 try
48 {
49 m_id = (String) id;
50 }
51 catch (ClassCastException cce)
52 {
53 throw new IllegalArgumentException("Specified ID is not a String.");
54 }
55 }
56
57 /**
58 * DOCUMENT_ME
59 *
60 * @param listener DOCUMENT_ME
61 */
62 public void addTerminationListener(org.apache.ws.resource.lifetime.ResourceTerminationListener listener)
63 {
64 m_terminationListeners.add(listener);
65 }
66
67 /**
68 * DOCUMENT_ME
69 *
70 * @return DOCUMENT_ME
71 */
72 public Object getID()
73 {
74 return m_id;
75 }
76
77 public void destroy()
78 {
79 org.apache.ws.resource.lifetime.ResourceTerminationEvent rte = new org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl(getID(), "Resource Destroyed");
80 for (int i = 0; i < m_terminationListeners.size(); i++)
81 {
82 org.apache.ws.resource.lifetime.ResourceTerminationListener resourceTerminationEventListener = (org.apache.ws.resource.lifetime.ResourceTerminationListener) m_terminationListeners.get(i);
83 resourceTerminationEventListener.terminationOccurred(rte);
84 }
85 return;
86 }
87
88 public void init()
89 {
90
91 com.dell.wsdm.demos.interop.x2005.x04.IPMIServerPropertiesDocument propsDoc = com.dell.wsdm.demos.interop.x2005.x04.IPMIServerPropertiesDocument.Factory.newInstance();
92 m_propSet = new org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet(propsDoc);
93
94
95 // initialize wsrl:Topic property
96 // TODO
97
98 // initialize wsrl:FixedTopicSet property
99 // TODO
100
101 // initialize wsrl:TopicExpressionDialects property
102 // TODO
103
104
105 }
106
107 /**
108 * @see org.apache.ws.resource.PropertiesResource#setResourcePropertySet(org.apache.ws.resource.properties.ResourcePropertySet)
109 */
110 public void setResourcePropertySet(org.apache.ws.resource.properties.ResourcePropertySet propSet)
111 {
112 m_propSet = propSet;
113 }
114
115 /**
116 * @see org.apache.ws.resource.PropertiesResource#getResourcePropertySet()
117 */
118 public org.apache.ws.resource.properties.ResourcePropertySet getResourcePropertySet()
119 {
120 return m_propSet;
121 }
122
123 org.apache.ws.notification.topics.TopicSpaceSet m_topicSpaceSet = new org.apache.ws.notification.topics.impl.TopicSpaceSetImpl(true);
124
125 public org.apache.ws.notification.topics.TopicSpaceSet getTopicSpaceSet()
126 {
127 return m_topicSpaceSet;
128 }
129
130 /**
131 * Returns the EndpointReference associated with this Resource.
132 *
133 * @return The Resource's EndpointReference or null if the EndpointReference has not been set.
134 * <p/>
135 * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl)
136 */
137 public EndpointReference getEndpointReference()
138 {
139 return m_endpointReference;
140 }
141
142 /**
143 * Sets the EndpointReference associated with this Resource.
144 *
145 * @param epr The Resource's EndpointReference.
146 * <p/>
147 * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl)
148 */
149 public void setEndpointReference(EndpointReference epr)
150 {
151 m_endpointReference = epr;
152 }
153 }