[Title] updated policy for signing web app
authorJihoon Song <jihoon80.song@samsung.com>
Tue, 28 Aug 2012 06:35:38 +0000 (15:35 +0900)
committerJihoon Song <jihoon80.song@samsung.com>
Tue, 28 Aug 2012 06:35:38 +0000 (15:35 +0900)
[Type] Enhancement
[Module] common-eplugin
[Priority] minor
[Jira#] --
[Redmine#] 6645
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: I3845cbc9b280e42efe89b3de5d99ec4070e02c85

org.tizen.common/src/org/tizen/common/core/command/EclipseExecutor.java
org.tizen.common/src/org/tizen/common/core/command/Executor.java
org.tizen.common/src/org/tizen/common/core/command/Policy.java
org.tizen.common/src/org/tizen/common/core/command/policy/SimplePolicy.java [new file with mode: 0644]

index 18b8fb7..ff02a58 100644 (file)
@@ -49,17 +49,6 @@ extends Executor
                                        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()
                                 */
@@ -68,24 +57,13 @@ extends Executor
                                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()
-                                       );
-                               };
                        }
                );
        }
index c035866..6cd4e29 100644 (file)
@@ -144,11 +144,19 @@ Executor
                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 )
@@ -170,6 +178,10 @@ Executor
                        }
                        handler.uncaughtException( Thread.currentThread(), e );
                }
+               finally
+               {
+               contexts.remove();
+               }
        }
        
        /**
index a4682a1..479d2f3 100644 (file)
@@ -141,6 +141,8 @@ extends Adaptable
         */
        String EXCEPTION_OUT_WGT = "exception.file.out.wgt";
        
+       String PRINTOUT_RESULT_SIGNING = "printout.result.signing";
+       
        /**
         * Return policy name
         * 
diff --git a/org.tizen.common/src/org/tizen/common/core/command/policy/SimplePolicy.java b/org.tizen.common/src/org/tizen/common/core/command/policy/SimplePolicy.java
new file mode 100644 (file)
index 0000000..77bac0d
--- /dev/null
@@ -0,0 +1,25 @@
+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;
+    }
+
+}