38 |
|
|
39 |
package gnu.CORBA.Interceptor; |
package gnu.CORBA.Interceptor; |
40 |
|
|
41 |
|
import org.omg.CORBA.OBJ_ADAPTER; |
42 |
|
import org.omg.CORBA.OMGVMCID; |
43 |
import org.omg.PortableInterceptor.IORInfo; |
import org.omg.PortableInterceptor.IORInfo; |
44 |
import org.omg.PortableInterceptor.IORInterceptor; |
import org.omg.PortableInterceptor.IORInterceptor; |
45 |
import org.omg.PortableInterceptor.IORInterceptorOperations; |
import org.omg.PortableInterceptor.IORInterceptorOperations; |
46 |
|
import org.omg.PortableInterceptor.IORInterceptor_3_0Operations; |
47 |
|
import org.omg.PortableInterceptor.ObjectReferenceTemplate; |
48 |
|
|
49 |
/** |
/** |
50 |
* A block of the all registered IOR interceptors. |
* A block of the all registered IOR interceptors. |
51 |
* |
* |
52 |
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) |
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) |
53 |
*/ |
*/ |
54 |
public class IORInterceptors implements IORInterceptorOperations |
public class IORInterceptors implements IORInterceptor_3_0Operations |
55 |
{ |
{ |
56 |
/** |
/** |
57 |
* The array of all registered IOR interceptors. |
* The array of all registered IOR interceptors. |
110 |
{ |
{ |
111 |
return getClass().getName(); |
return getClass().getName(); |
112 |
} |
} |
113 |
|
|
114 |
|
/** |
115 |
|
* Call this method for all registered CORBA 3.0 interceptors. |
116 |
|
*/ |
117 |
|
public void adapter_manager_state_changed(int adapterManagerId, short adapterState) |
118 |
|
{ |
119 |
|
for (int i = 0; i < interceptors.length; i++) |
120 |
|
{ |
121 |
|
try |
122 |
|
{ |
123 |
|
if (interceptors[i] instanceof IORInterceptor_3_0Operations) |
124 |
|
{ |
125 |
|
((IORInterceptor_3_0Operations) interceptors[i]). |
126 |
|
adapter_manager_state_changed(adapterManagerId, adapterState); |
127 |
|
} |
128 |
|
} |
129 |
|
catch (Exception exc) |
130 |
|
{ |
131 |
|
OBJ_ADAPTER oa = new OBJ_ADAPTER("components_established failed"); |
132 |
|
oa.initCause(exc); |
133 |
|
oa.minor = 6 | OMGVMCID.value; |
134 |
|
throw oa; |
135 |
|
} |
136 |
|
} |
137 |
|
} |
138 |
|
|
139 |
|
/** |
140 |
|
* Call this method for all registered CORBA 3.0 interceptors. |
141 |
|
*/ |
142 |
|
public void adapter_state_changed(ObjectReferenceTemplate[] adapters, short adaptersState) |
143 |
|
{ |
144 |
|
for (int i = 0; i < interceptors.length; i++) |
145 |
|
{ |
146 |
|
try |
147 |
|
{ |
148 |
|
if (interceptors[i] instanceof IORInterceptor_3_0Operations) |
149 |
|
{ |
150 |
|
((IORInterceptor_3_0Operations) interceptors[i]). |
151 |
|
adapter_state_changed(adapters, adaptersState); |
152 |
|
} |
153 |
|
} |
154 |
|
catch (Exception exc) |
155 |
|
{ |
156 |
|
OBJ_ADAPTER oa = new OBJ_ADAPTER("components_established failed"); |
157 |
|
oa.initCause(exc); |
158 |
|
oa.minor = 6 | OMGVMCID.value; |
159 |
|
throw oa; |
160 |
|
} |
161 |
|
} |
162 |
|
} |
163 |
|
|
164 |
|
/** |
165 |
|
* Call this method for all registered CORBA 3.0 interceptors. |
166 |
|
* |
167 |
|
* @throws OBJ_ADAPTER minor 6 on any failure (as defined by OMG specs). |
168 |
|
*/ |
169 |
|
public void components_established(IORInfo info) |
170 |
|
{ |
171 |
|
for (int i = 0; i < interceptors.length; i++) |
172 |
|
{ |
173 |
|
try |
174 |
|
{ |
175 |
|
if (interceptors[i] instanceof IORInterceptor_3_0Operations) |
176 |
|
{ |
177 |
|
((IORInterceptor_3_0Operations) interceptors[i]). |
178 |
|
components_established(info); |
179 |
|
} |
180 |
|
} |
181 |
|
catch (Exception exc) |
182 |
|
{ |
183 |
|
OBJ_ADAPTER oa = new OBJ_ADAPTER("components_established failed"); |
184 |
|
oa.initCause(exc); |
185 |
|
oa.minor = 6 | OMGVMCID.value; |
186 |
|
throw oa; |
187 |
|
} |
188 |
|
} |
189 |
|
} |
190 |
} |
} |