appendTextChild(ejbNode, EjbTagNames.SESSION_TYPE, ejbDesc.getSessionType());
if( ejbDesc.hasStatefulTimeout() ) {
TimeoutValueNode timeoutValueNode = new TimeoutValueNode();
TimeoutValueDescriptor timeoutDesc = new TimeoutValueDescriptor();
timeoutDesc.setValue(ejbDesc.getStatefulTimeoutValue());
timeoutDesc.setUnit(ejbDesc.getStatefulTimeoutUnit());
timeoutValueNode.writeDescriptor(ejbNode, EjbTagNames.STATEFUL_TIMEOUT,
timeoutDesc);
}
MethodNode methodNode = new MethodNode();
if( ejbDesc.isTimedObject() ) {
if (ejbDesc.getEjbTimeoutMethod() != null) {
methodNode.writeJavaMethodDescriptor
(ejbNode, EjbTagNames.TIMEOUT_METHOD,
ejbDesc.getEjbTimeoutMethod());
}
for ( ScheduledTimerDescriptor timerDesc : ejbDesc.getScheduledTimerDescriptors()) {
ScheduledTimerNode timerNode = new ScheduledTimerNode();
timerNode.writeDescriptor(ejbNode, EjbTagNames.TIMER, timerDesc);
}
}
if( ejbDesc.isSingleton() ) {
appendTextChild(ejbNode, EjbTagNames.INIT_ON_STARTUP,
Boolean.toString(ejbDesc.getInitOnStartup()));
}
if( !ejbDesc.isStateless() ) {
appendTextChild(ejbNode, EjbTagNames.CONCURRENCY_MANAGEMENT_TYPE,
ejbDesc.getConcurrencyManagementType().toString());
}
for(EjbSessionDescriptor.AccessTimeoutHolder next : ejbDesc.getAccessTimeoutInfo()) {
ConcurrentMethodDescriptor cDesc = new ConcurrentMethodDescriptor();
cDesc.setConcurrentMethod(next.method);
TimeoutValueDescriptor timeoutDesc = new TimeoutValueDescriptor();
timeoutDesc.setValue(next.value);
timeoutDesc.setUnit(next.unit);
cDesc.setAccessTimeout(timeoutDesc);
ConcurrentMethodNode cNode = new ConcurrentMethodNode();
cNode.writeDescriptor(ejbNode, EjbTagNames.CONCURRENT_METHOD, cDesc);
}