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);
}
for(MethodDescriptor nextReadLock : ejbDesc.getReadLockMethods()) {
ConcurrentMethodDescriptor cDesc = new ConcurrentMethodDescriptor();
cDesc.setConcurrentMethod(nextReadLock);
cDesc.setWriteLock(false);
ConcurrentMethodNode cNode = new ConcurrentMethodNode();
cNode.writeDescriptor(ejbNode, EjbTagNames.CONCURRENT_METHOD, cDesc);
}
if( ejbDesc.hasDependsOn()) {
Node dependsOnNode = appendChild(ejbNode, EjbTagNames.DEPENDS_ON);
for(String depend : ejbDesc.getDependsOn()) {
appendTextChild(dependsOnNode, EjbTagNames.EJB_NAME, depend);
}
}
if( ejbDesc.hasInitMethods() ) {
EjbInitNode initNode = new EjbInitNode();
for(EjbInitInfo next : ejbDesc.getInitMethods()) {
initNode.writeDescriptor(ejbNode,
EjbTagNames.INIT_METHOD, next);
}
}
if( ejbDesc.hasRemoveMethods() ) {
EjbRemoveNode removeNode = new EjbRemoveNode();
for(EjbRemovalInfo next : ejbDesc.getAllRemovalInfo()) {
removeNode.writeDescriptor(ejbNode,
EjbTagNames.REMOVE_METHOD, next);
}
}
for(MethodDescriptor nextDesc : ejbDesc.getAsynchronousMethods()) {
methodNode.writeDescriptor(ejbNode, EjbTagNames.ASYNC_METHOD, nextDesc,
ejbDesc.getName());
}
appendTextChild(ejbNode, EjbTagNames.TRANSACTION_TYPE, ejbDesc.getTransactionType());
MethodDescriptor afterBeginMethod = ejbDesc.getAfterBeginMethod();
if( afterBeginMethod != null ) {
methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.AFTER_BEGIN_METHOD,
afterBeginMethod);
}
MethodDescriptor beforeCompletionMethod = ejbDesc.getBeforeCompletionMethod();
if( beforeCompletionMethod != null ) {
methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.BEFORE_COMPLETION_METHOD,
beforeCompletionMethod);
}
MethodDescriptor afterCompletionMethod = ejbDesc.getAfterCompletionMethod();
if( afterCompletionMethod != null ) {
methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.AFTER_COMPLETION_METHOD,
afterCompletionMethod);
}
//around-invoke-method