SFSBClientRequestInterceptorpublic class SFSBClientRequestInterceptor extends SFSBAbstractInterceptor implements ClientRequestInterceptorThis is the implementation of the JTS PI-based client/server interceptor.
This will be called during request/reply invocation path. |
Fields Summary |
---|
private static final Level | TRACE_LEVEL | private static final Level | TRACE_LEVEL_FINE |
Constructors Summary |
---|
public SFSBClientRequestInterceptor(org.omg.IOP.Codec codec)
super("com.sun.enterprise.iiop.SFSBClientRequestInterceptor", codec);
|
Methods Summary |
---|
public boolean | doesSFSBVersionPolicyExist(ClientRequestInfo ri)
boolean result = false;
try {
TaggedComponent sfsbVersionTag = ri
.get_effective_component(POARemoteReferenceFactory.SFSB_VERSION_POLICY_TYPE);
result = (sfsbVersionTag != null);
} catch (BAD_PARAM e) {
// ignore
}
return result;
| private void | receiveSFSBVersionNumber(java.lang.String callName, ClientRequestInfo ri)
try {
if (doesSFSBVersionPolicyExist(ri)) {
EJBTargetKeyInfo oidInfo = new EJBTargetKeyInfo(ri.effective_target());
ServiceContext ctx = ri.get_reply_service_context(
SFSBVersionConstants.SFSB_VERSION_SERVICE_CONTEXT_ID);
if (ctx != null) {
long version = Utility.bytesToLong(ctx.context_data, 0);
SFSBClientVersionManager.setClientVersion(oidInfo.getContainerId(),
oidInfo.getInstanceKey(), version);
if (_logger.isLoggable(TRACE_LEVEL)) {
_logger.log(TRACE_LEVEL, "SFSBClientInterceptor." + callName
+ " " + ri.operation() + " " + oidInfo
+ " version: " + version);
}
}
}
} catch (Throwable th) {
_logger.log(Level.FINE, "SFSBClientInterceptor::receiveSFSBVersionNumber"
+ " Got exception: ", th);
}
| public void | receive_exception(ClientRequestInfo ri)
receiveSFSBVersionNumber("receive_exception", ri);
| public void | receive_other(ClientRequestInfo ri)
if (doesSFSBVersionPolicyExist(ri)) {
EJBTargetKeyInfo oidInfo = new EJBTargetKeyInfo(ri
.effective_target());
if (_logger.isLoggable(Level.WARNING)) {
_logger.log(Level.WARNING, "**SFSBClientInterceptor.receive_other...: "
+ oidInfo);
}
}
| public void | receive_reply(ClientRequestInfo ri)
receiveSFSBVersionNumber("receive_reply", ri);
| public void | send_poll(ClientRequestInfo ri)
// do nothing.
| public void | send_request(ClientRequestInfo ri)
if (doesSFSBVersionPolicyExist(ri)) {
EJBTargetKeyInfo oidInfo = new EJBTargetKeyInfo(ri
.effective_target());
if (_logger.isLoggable(TRACE_LEVEL_FINE)) {
_logger.log(TRACE_LEVEL_FINE, "**SFSBClientInterceptor.send_request...: "
+ ri.operation() + " " + oidInfo);
}
try {
//Any anyData = ri.get_slot(getSlotID());
long version = SFSBClientVersionManager.getClientVersion(oidInfo.getContainerId(),
oidInfo.getInstanceKey());
//version = ++versionCounter;
//anyData.insert_longlong(version);
byte[] data = new byte[8];
Utility.longToBytes(version, data, 0);
ri.add_request_service_context(new ServiceContext(
SFSBVersionConstants.SFSB_VERSION_SERVICE_CONTEXT_ID, data),
false);
if (_logger.isLoggable(TRACE_LEVEL)) {
_logger.log(TRACE_LEVEL, "SFSBClientInterceptor.send_request. anyData: " + version);
}
} catch (Exception e) {
if (_logger.isLoggable(TRACE_LEVEL)) {
_logger.log(TRACE_LEVEL, "SFSBClientInterceptor.send_request. Exception", e);
}
}
}
|
|