new DynamicApplicationContext (context.getPolicyContext ());
dynamicContext.setMessageIdentifier (context.getMessageIdentifier ());
dynamicContext.inBoundMessage (false);
// TODO: copy runtime properties into callback context
DynamicPolicyCallback callback =
new DynamicPolicyCallback (policyClone, dynamicContext);
ProcessingContext.copy (dynamicContext.getRuntimeProperties(), context.getExtraneousProperties());
HarnessUtil.makeDynamicPolicyCallback(callback,
context.getSecurityEnvironment().getCallbackHandler());
} catch (Exception e) {
log.log(Level.SEVERE, "Message does not conform to time stamp policy", e);
throw new XWSSecurityException (e);
}
timeout = policyClone.getTimeout();
created = policyClone.getCreationTime();
}
setTimestamp(context, timeout, created, id);
//hack to prevent multiple timestamp exports
//TODO: revisit
context.timestampExported(true);
} else {
// Processing inbound messages
Timestamp timestamp = null;
if (context.getMode() == FilterProcessingContext.ADHOC) {
if (context.makeDynamicPolicyCallback()) {
TimestampPolicy policyClone = (TimestampPolicy)
((TimestampPolicy)context.getSecurityPolicy()).clone();
try {
DynamicApplicationContext dynamicContext =
new DynamicApplicationContext (context.getPolicyContext ());
dynamicContext.setMessageIdentifier (context.getMessageIdentifier ());
dynamicContext.inBoundMessage (true);
DynamicPolicyCallback callback =
new DynamicPolicyCallback (policyClone, dynamicContext);
ProcessingContext.copy (dynamicContext.getRuntimeProperties(), context.getExtraneousProperties());
HarnessUtil.makeDynamicPolicyCallback(callback,
context.getSecurityEnvironment().getCallbackHandler());
} catch (Exception e) {