return factory.create();
}
- /**
- * {@link ExecutionContext} for Command Line Interface
- */
- protected
- final
- ExecutionContext context = new ExecutionContext(
- getRegistry(),
- prompter,
- fileHandler
- );
-
/* (non-Javadoc)
* @see org.tizen.common.core.command.ExecutionContextFactory#create()
*/
ExecutionContext
create()
{
- return context;
+ return new ExecutionContext(
+ getRegistry(),
+ prompter,
+ fileHandler
+ );
}
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public
- String
- toString()
- {
- return MessageFormat.format(
- "Policy :{0}, Prompter :{1}, File Handler :{2}",
- context.getPolicyRegistry(),
- context.getPrompter(),
- context.getFileHandler()
- );
- };
}
);
}
final Command<?>... commands
)
{
- logger.trace( "Commands :{}", commands );
- contexts.remove();
-
- logger.debug( "Context initialize" );
- final ExecutionContext context = contexts.get();
+ logger.trace( "Commands :{}", commands );
+ contexts.remove();
+
+ execute( contexts.get(), commands );
+
+ }
+ public
+ void
+ execute(
+ final ExecutionContext context,
+ final Command<?>... commands
+ )
+ {
try {
for ( final Command<?> command : commands )
}
handler.uncaughtException( Thread.currentThread(), e );
}
+ finally
+ {
+ contexts.remove();
+ }
}
/**
*/
String EXCEPTION_OUT_WGT = "exception.file.out.wgt";
+ String PRINTOUT_RESULT_SIGNING = "printout.result.signing";
+
/**
* Return policy name
*
--- /dev/null
+package org.tizen.common.core.command.policy;
+
+import org.tizen.common.core.command.Policy;
+
+public class SimplePolicy
+implements Policy {
+
+ protected String name;
+
+ public SimplePolicy( final String name )
+ {
+ this.name = name;
+ }
+ @Override
+ public <T> T adapt(Class<T> clazz) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+}