コード例 #1
0
ファイル: StateExpiryTask.java プロジェクト: rajsanka/a-smart
 public void run() {
   try {
     RuntimeShell rshell = RuntimeShell.currentRuntimeShell();
     threads().addToContextLocals(SYSTEM_RUNTIME, "TimedEvent");
     SmartData data = (SmartData) rshell.lookupFor(objectflow, objectgroup, objectkey);
     assertion()
         .assertNotNull(
             data,
             "Cannot find data to post timed event to. "
                 + objectflow
                 + ":"
                 + objectgroup
                 + ":"
                 + objectkey
                 + ":"
                 + this.getClass().getClassLoader());
     Object evt = new TimedEvent("stateexpired", data);
     SmartEvent event = (SmartEvent) evt;
     // MessageConfig mc = new MessageConfig(event);
     CoreContext ctx = (CoreContext) anatomy().overriddenContext(this.getClass());
     MessageConfig mc = (MessageConfig) ctx.getMessageConfig(event);
     mc.postMessage();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
コード例 #2
0
 protected Object runtimeObject(Class cls) throws CtxException {
   CrossLinkSmartTenant tenant = CrossLinkSmartTenant.currentTenant();
   RuntimeShell shell = (RuntimeShell) tenant.runtimeShell();
   Object transition = shell.getTransition(cls);
   return transition;
 }