use of jp.ossc.nimbus.ioc.Command in project nimbus by nimbus-org.
the class EJBDriveDispatcher method invokeUnitOfWorkBase.
/**
* ユニットオブワークを実行する
* @param uow 入力ユニットオブワーク
* @return 出力ユニットオブワーク
* @throws Throwable
*/
public UnitOfWork invokeUnitOfWorkBase(UnitOfWork uow) throws Exception {
UnitOfWork retUow = FacadeValueAccess.createCommandsValue();
boolean cmdErrFlg = false;
// 配列分実行する
if (this.getLogger() != null) {
this.getLogger().write(IOC__00002);
}
for (int rcnt = 0; rcnt < uow.size(); rcnt++) {
CommandBase tmp = uow.getCommand(rcnt);
try {
if (tmp.isCommand()) {
if (!cmdErrFlg) {
if (mCommandInvokerRemote == null) {
mCommandInvokerRemote = mCommandInvokerHome.create();
if (this.getLogger() != null) {
this.getLogger().write(IOC__00001, "SLSBCommandHomeLocal get cmpleted.");
}
}
Command ret = this.mCommandInvokerRemote.invokeCommand((Command) tmp);
if (ret.getStatus() == CommandBase.C_STATUS_ERROR) {
if (this.getLogger() != null) {
this.getLogger().write("IOC__00020");
}
this.getContext().setRollbackOnly();
cmdErrFlg = true;
}
retUow.addCommand(ret);
} else {
if (this.getLogger() != null) {
this.getLogger().write("IOC__00021");
}
retUow.addCommand((Command) tmp);
}
} else {
if (this.getLogger() != null) {
this.getLogger().write("IOC__00015");
}
if (mUnitOfWorkInvokerRemote == null) {
mUnitOfWorkInvokerRemote = mUnitOfWorkInvokerHome.create();
if (this.getLogger() != null) {
this.getLogger().write(IOC__00001, "SLSBUnitOfWorkHomeLocal get cmpleted.");
}
}
UnitOfWork ret = this.mUnitOfWorkInvokerRemote.invokeUnitOfWork((UnitOfWork) tmp);
retUow.addUnitOfWork(ret);
}
} catch (EJBException e) {
if (this.getLogger() != null) {
this.getLogger().write("IOC__00017", e.getCausedByException());
}
Exception ex = (Exception) e.getCausedByException();
throw ex;
} catch (Throwable e) {
if (this.getLogger() != null) {
this.getLogger().write("IOC__00017", e);
}
IOCException ex = new IOCException("EJBDispatcher#invokeUnitOfWorkBase Unrecognized Error ", e);
throw ex;
}
}
return retUow;
}
use of jp.ossc.nimbus.ioc.Command in project nimbus by nimbus-org.
the class CommandJournalEditorService method processBlock.
protected boolean processBlock(EditorFinder finder, Object key, Object value, StringBuilder buf) {
final Command command = (Command) value;
boolean isMake = false;
if (isOutputFlowKey()) {
makeFlowKeyFormat(finder, key, command, buf);
isMake = true;
}
if (isOutputInput()) {
if (isMake) {
buf.append(getLineSeparator());
}
makeInputFormat(finder, key, command, buf);
isMake = true;
}
if (isOutputOutput()) {
if (isMake) {
buf.append(getLineSeparator());
}
makeOutputFormat(finder, key, command, buf);
isMake = true;
}
if (isOutputStatus()) {
if (isMake) {
buf.append(getLineSeparator());
}
makeStatusFormat(finder, key, command, buf);
isMake = true;
}
if (isOutputException()) {
if (isMake) {
buf.append(getLineSeparator());
}
makeExceptionFormat(finder, key, command, buf);
isMake = true;
}
return isMake;
}
Aggregations