1 package org.enhydra.shark.corba.poa; 2 3 import org.omg.WfBase.*; 4 import org.omg.WorkflowModel.*; 5 import org.enhydra.shark.corba.WorkflowService.*; 6 import org.enhydra.shark.corba.poa.ApplicationMapCORBA; 7 import org.enhydra.shark.corba.poa.Collective; 8 import org.enhydra.shark.corba.poa.ParticipantMapCORBA; 9 import org.omg.CORBA.*; 10 import org.omg.PortableServer.POA ; 11 import org.omg.PortableServer.POAHelper ; 12 import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; 13 import org.omg.PortableServer.POAPackage.WrongPolicy ; 14 import org.omg.PortableServer.POAPackage.ServantNotActive ; 15 16 import java.util.*; 17 18 import org.enhydra.shark.utilities.SequencedHashMap; 19 20 import java.io.Serializable ; 21 22 28 public class SharkCORBAUtilities { 29 30 static POA rootPOA; 31 static ORB orb; 32 33 static void setPOA(POA poa) { 34 rootPOA = poa; 35 } 36 static void setORB(ORB the_orb) { 37 orb = the_orb; 38 } 39 static POA getPOA() { 40 return rootPOA; 41 } 42 static NameValueInfo makeCORBANameValueInfo(String attribute_name, 43 String type_name) { 44 NameValueInfo nvic = new NameValueInfo(); 45 nvic.attribute_name = attribute_name; 46 nvic.type_name = type_name; 47 return nvic; 48 } 49 50 static NameValueInfo[] makeCORBANameValueInfoArray(Map nvia) { 51 int size = 0; 52 if (nvia != null) size = nvia.size(); 53 NameValueInfo[] nvica = new NameValueInfo[size]; 54 int i = 0; 55 if (nvia != null) { 56 for (Iterator it = nvia.entrySet().iterator(); it.hasNext(); i++) { 57 Map.Entry me = (Map.Entry) it.next(); 58 nvica[i] = makeCORBANameValueInfo(me.getKey().toString(), 59 me.getValue().toString()); 60 } 61 } 62 return nvica; 63 } 64 65 static NameValue makeCORBANameValue(ORB orb, 66 String the_name, 67 java.lang.Object the_value) { 68 NameValue nvc = new NameValue(); 69 nvc.the_name = the_name; 70 nvc.the_value = createAnyFromValue(orb, the_value); 71 return nvc; 72 } 73 74 static NameValue[] makeCORBANameValueArray(ORB orb, Map nva) { 75 int size = 0; 76 if (nva != null) size = nva.size(); 77 NameValue[] nvca = new NameValue[size]; 78 int i = 0; 79 if (nva != null) { 80 for (Iterator it = nva.entrySet().iterator(); it.hasNext(); i++) { 81 Map.Entry me = (Map.Entry) it.next(); 82 nvca[i] = makeCORBANameValue(orb, 83 me.getKey().toString(), 84 me.getValue()); 85 } 86 } 87 return nvca; 88 } 89 90 static NameValue[] makeCORBANameValueArray(ORB orb, String [][] nva) { 91 int size = 0; 92 if (nva != null) size = nva.length; 93 94 NameValue[] nvca = new NameValue[size]; 95 if (nva != null) { 96 for (int i = 0; i < size; i++) { 97 nvca[i] = makeCORBANameValue(orb, nva[i][0], nva[i][1]); 98 } 99 } 100 return nvca; 101 } 102 103 static NameValue[] makeCORBANameValueArray(ORB orb, Properties props) { 104 int size = 0; 105 if (props != null) size = props.size(); 106 NameValue[] nvca = new NameValue[size]; 107 if (props != null) { 108 Iterator it = props.entrySet().iterator(); 109 int i = 0; 110 while (it.hasNext()) { 111 Map.Entry me = (Map.Entry) it.next(); 112 nvca[i] = makeCORBANameValue(orb, 113 (String ) me.getKey(), 114 (String ) me.getValue()); 115 i++; 116 } 117 } 118 return nvca; 119 } 120 121 static Map makeMap(NameValue[] nvca) { 122 Map m = new SequencedHashMap(); 123 if (nvca != null) { 124 for (int i = 0; i < nvca.length; i++) { 125 m.put(nvca[i].the_name, extractValueFromAny(nvca[i].the_value)); 126 } 127 } 128 return m; 129 } 130 131 static DeadlineInfo[] makeDeadlineInfoArray(org.enhydra.shark.api.common.DeadlineInfo[] di) { 132 DeadlineInfo[] cdi = new DeadlineInfo[di.length]; 133 for (int i = 0; i < di.length; i++) { 134 cdi[i] = new DeadlineInfo(); 135 cdi[i].procId = di[i].procId; 136 cdi[i].actId = di[i].actId; 137 cdi[i].isExecuted = di[i].isExecuted; 138 cdi[i].timeLimit = di[i].timeLimit; 139 cdi[i].exceptionName = di[i].exceptionName; 140 cdi[i].isSynchronous = di[i].isSynchronous; 141 } 142 return cdi; 143 } 144 145 static java.lang.Object extractValueFromAny(Any any) { 146 java.lang.Object value = null; 147 try { 148 int kind = any.type().kind().value(); 149 if (kind == TCKind._tk_boolean) { 150 value = new Boolean (any.extract_boolean()); 151 } else if (kind == TCKind._tk_wstring) { 152 value = new String (any.extract_wstring()); 153 } else if (kind == TCKind._tk_long) { 154 value = new Integer (any.extract_long()); 155 } else if (kind == TCKind._tk_longlong) { 156 value = new Long (any.extract_longlong()); 157 } else if (kind == TCKind._tk_double) { 158 value = new Double (any.extract_double()); 159 } else if (kind == TCKind._tk_value) { 160 value = any.extract_Value(); 161 } 162 } catch (BAD_OPERATION bo) { 163 System.out.println("Extracting value failed - bo exception "+bo); 164 return null; 166 } 167 return value; 168 } 169 170 static Any createAnyFromValue(ORB orb, java.lang.Object value) { 171 Any any = orb.create_any(); 172 173 try { 174 if (value instanceof Boolean ) { 175 any.insert_boolean(((Boolean ) value).booleanValue()); 176 } else if (value instanceof String ) { 177 any.insert_wstring((String ) value); 178 } else if (value instanceof Long ) { 179 any.insert_longlong(((Long ) value).longValue()); 180 } else if (value instanceof Double ) { 181 any.insert_double(((Double ) value).doubleValue()); 182 } else if (value instanceof Serializable ) { 183 any.insert_Value((Serializable ) value); 184 } 185 } catch (BAD_OPERATION bo) { 186 System.out.println("Creating any from val failed - bo exception"); 187 } 189 return any; 190 } 191 192 static WfProcessMgr[] makeCORBAProcessMgrs(org.omg.CORBA.ORB orb, Collective toJoin, 193 org.enhydra.shark.api.client.wfmodel.WfProcessMgr[] objs) { 194 int size = 0; 195 if (objs != null) size = objs.length; 196 WfProcessMgr[] cobjs = new WfProcessMgr[size]; 197 for (int i = 0; i < cobjs.length; i++) { 198 try { 199 cobjs[i] = makeWfProcessMgr(new WfProcessMgrCORBA(orb, toJoin, objs[i])); 200 toJoin.__recruit(cobjs[i]); 201 } catch (Exception ex) { 202 ex.printStackTrace(); 203 } 204 } 205 return cobjs; 206 } 207 208 static WfProcess[] makeCORBAProcesses(Collective toJoin, 209 org.enhydra.shark.api.client.wfmodel.WfProcess[] objs) { 210 int size = 0; 211 if (objs != null) size = objs.length; 212 WfProcess[] cobjs = new WfProcess[size]; 213 for (int i = 0; i < cobjs.length; i++) { 214 cobjs[i] = makeWfProcess(new WfProcessCORBA(orb, toJoin, objs[i])); 215 toJoin.__recruit(cobjs[i]); 216 } 217 return cobjs; 218 } 219 220 static WfActivity[] makeCORBAActivities(Collective toJoin, 221 org.enhydra.shark.api.client.wfmodel.WfActivity[] objs) { 222 int size = 0; 223 if (objs != null) size = objs.length; 224 WfActivity[] cobjs = new WfActivity[size]; 225 for (int i = 0; i < cobjs.length; i++) { 226 cobjs[i] = makeWfActivity(new WfActivityCORBA(orb, toJoin, objs[i])); 227 toJoin.__recruit(cobjs[i]); 228 } 229 return cobjs; 230 } 231 232 static WfAssignment[] makeCORBAAssignments( Collective toJoin, 233 org.enhydra.shark.api.client.wfmodel.WfAssignment[] objs) { 234 int size = 0; 235 if (objs != null) size = objs.length; 236 WfAssignment[] cobjs = new WfAssignment[size]; 237 for (int i = 0; i < cobjs.length; i++) { 238 try { 239 cobjs[i] = makeWfAssignment(new WfAssignmentCORBA(orb, toJoin, objs[i])); 240 toJoin.__recruit(cobjs[i]); 241 } catch (Exception ex) { 242 ex.printStackTrace(); 243 } 244 } 245 return cobjs; 246 } 247 248 static WfResource[] makeCORBAResources(Collective toJoin, 249 org.enhydra.shark.api.client.wfmodel.WfResource[] objs) { 250 int size = 0; 251 if (objs != null) size = objs.length; 252 WfResource[] cobjs = new WfResource[size]; 253 for (int i = 0; i < cobjs.length; i++) { 254 try { 255 cobjs[i] = makeWfResource( new WfResourceCORBA(orb, toJoin, objs[i])); 256 toJoin.__recruit(cobjs[i]); 257 } catch (Exception ex) { 258 ex.printStackTrace(); 259 } 260 } 261 return cobjs; 262 } 263 264 static WfEventAudit makeCORBAEventAudit(Collective toJoin, 265 org.enhydra.shark.api.client.wfmodel.WfEventAudit obj) { 266 try { 267 if (obj instanceof org.enhydra.shark.api.client.wfmodel.WfCreateProcessEventAudit) { 268 WfCreateProcessEventAuditCORBA impl = new WfCreateProcessEventAuditCORBA(orb, toJoin, 269 (org.enhydra.shark.api.client.wfmodel.WfCreateProcessEventAudit) obj); 270 WfCreateProcessEventAudit ret = null; 271 try { 272 byte[] o = rootPOA.activate_object(impl); 273 ret = WfCreateProcessEventAuditHelper.narrow(rootPOA.id_to_reference(o)); 274 toJoin.__recruit(ret); 275 } catch (ServantAlreadyActive servantAlreadyActive) { 276 servantAlreadyActive.printStackTrace(); 277 } catch (WrongPolicy wrongPolicy) { 278 wrongPolicy.printStackTrace(); 279 } catch (Exception ex) { 280 System.err.println("WfCreateProcessEventAudit: "+ex); 281 } 282 return ret; 283 } else if (obj instanceof org.enhydra.shark.api.client.wfmodel.WfAssignmentEventAudit) { 284 WfAssignmentEventAuditCORBA impl = new WfAssignmentEventAuditCORBA(orb, toJoin, 285 (org.enhydra.shark.api.client.wfmodel.WfAssignmentEventAudit) obj); 286 WfAssignmentEventAudit ret = null; 287 try { 288 byte[] o = rootPOA.activate_object(impl); 290 ret = WfAssignmentEventAuditHelper.narrow(rootPOA.id_to_reference(o)); 291 toJoin.__recruit(ret); 292 } catch (ServantAlreadyActive servantAlreadyActive) { 293 servantAlreadyActive.printStackTrace(); 294 } catch (WrongPolicy wrongPolicy) { 295 wrongPolicy.printStackTrace(); 296 299 } catch (Exception ex) { 300 System.err.println("WfAssignmentEventAudit creation: "+ex); 301 } 302 return ret; 303 } else if (obj instanceof org.enhydra.shark.api.client.wfmodel.WfDataEventAudit) { 304 WfDataEventAuditCORBA impl = new WfDataEventAuditCORBA(orb, toJoin, 305 (org.enhydra.shark.api.client.wfmodel.WfDataEventAudit) obj); 306 WfDataEventAudit ret = null; 307 try { 308 311 byte[] o = rootPOA.activate_object(impl); 312 ret = WfDataEventAuditHelper.narrow(rootPOA.id_to_reference(o)); 313 toJoin.__recruit(ret); 314 } catch (ServantAlreadyActive servantAlreadyActive) { 315 servantAlreadyActive.printStackTrace(); 316 } catch (WrongPolicy wrongPolicy) { 317 wrongPolicy.printStackTrace(); 318 321 } catch (Exception ex) { 322 System.err.println("WfDataEventAudit creation: "+ex); 323 } 324 return ret; 325 } else if (obj instanceof org.enhydra.shark.api.client.wfmodel.WfStateEventAudit) { 326 WfStateEventAuditCORBA impl = new WfStateEventAuditCORBA(toJoin, 327 (org.enhydra.shark.api.client.wfmodel.WfStateEventAudit) obj); 328 WfStateEventAudit ret = null; 329 try { 330 333 byte[] o = rootPOA.activate_object(impl); 334 ret = WfStateEventAuditHelper.narrow(rootPOA.id_to_reference(o)); 335 toJoin.__recruit(ret); 336 } catch (ServantAlreadyActive servantAlreadyActive) { 337 servantAlreadyActive.printStackTrace(); 338 } catch (WrongPolicy wrongPolicy) { 339 wrongPolicy.printStackTrace(); 340 343 } catch (Exception ex) { 344 System.err.println("WfStateEventAudit creation: "+ex); 345 } 346 return ret; 347 } else { 348 return null; 349 } 350 } catch (Exception ex) { 351 return null; 352 } 353 } 354 355 static WfEventAudit[] makeCORBAEventAudits(Collective toJoin, 356 org.enhydra.shark.api.client.wfmodel.WfEventAudit[] objs) { 357 int size = 0; 358 if (objs != null) size = objs.length; 359 WfEventAudit[] cobjs = new WfEventAudit[size]; 360 for (int i = 0; i < cobjs.length; i++) { 361 cobjs[i] = makeCORBAEventAudit(toJoin, objs[i]); 362 toJoin.__recruit(cobjs[i]); 363 } 364 return cobjs; 365 } 366 367 static WfStateEventAudit[] makeCORBAStateEventAudits(Collective toJoin, 368 org.enhydra.shark.api.client.wfmodel.WfEventAudit[] objs) throws Exception { 369 int size = 0; 370 if (objs != null) size = objs.length; 371 WfStateEventAudit[] cobjs = new WfStateEventAudit[size]; 372 for (int i = 0; i < cobjs.length; i++) { 373 cobjs[i] = (WfStateEventAudit) makeCORBAEventAudit(toJoin, objs[i]); 374 toJoin.__recruit(cobjs[i]); 375 } 376 return cobjs; 377 } 378 379 static WfDataEventAudit[] makeCORBADataEventAudits(Collective toJoin, 380 org.enhydra.shark.api.client.wfmodel.WfEventAudit[] objs) throws Exception { 381 int size = 0; 382 if (objs != null) size = objs.length; 383 WfDataEventAudit[] cobjs = new WfDataEventAudit[size]; 384 for (int i = 0; i < cobjs.length; i++) { 385 cobjs[i] = (WfDataEventAudit) makeCORBAEventAudit(toJoin, objs[i]); 386 toJoin.__recruit(cobjs[i]); 387 } 388 return cobjs; 389 } 390 391 static WfAssignmentEventAudit[] makeCORBAAssignmentEventAudits(Collective toJoin, 392 org.enhydra.shark.api.client.wfmodel.WfEventAudit[] objs) throws Exception { 393 int size = 0; 394 if (objs != null) size = objs.length; 395 WfAssignmentEventAudit[] cobjs = new WfAssignmentEventAudit[size]; 396 for (int i = 0; i < cobjs.length; i++) { 397 cobjs[i] = (WfAssignmentEventAudit) makeCORBAEventAudit(toJoin, 398 objs[i]); 399 toJoin.__recruit(cobjs[i]); 400 } 401 return cobjs; 402 } 403 404 static ParticipantMap[] makeCORBAParticipantMaps(Collective toJoin, 405 org.enhydra.shark.api.client.wfservice.ParticipantMap[] objs) { 406 int size = 0; 407 if (objs != null) size = objs.length; 408 ParticipantMap[] cobjs = new ParticipantMap[size]; 409 for (int i = 0; i < cobjs.length; i++) { 410 cobjs[i] = makeParticipantMap(new ParticipantMapCORBA(objs[i])); 411 toJoin.__recruit(cobjs[i]); 412 } 413 return cobjs; 414 } 415 416 static ApplicationMap[] makeCORBAApplicationMaps(ORB orb, Collective toJoin, 417 org.enhydra.shark.api.client.wfservice.ApplicationMap[] objs) { 418 int size = 0; 419 if (objs != null) size = objs.length; 420 ApplicationMap[] cobjs = new ApplicationMap[size]; 421 for (int i = 0; i < cobjs.length; i++) { 422 cobjs[i] = makeApplicationMap(new ApplicationMapCORBA(toJoin, objs[i])); 423 toJoin.__recruit(cobjs[i]); 424 } 425 return cobjs; 426 } 427 428 static org.enhydra.shark.api.client.wfservice.ApplicationMap fillApplicationMap(org.enhydra.shark.api.client.wfservice.ApplicationMap nm, 429 ApplicationMap am) { 430 nm.setToolAgentClassName(am.getToolAgentClassName()); 431 nm.setUsername(am.getUsername()); 432 nm.setPassword(am.getPassword()); 433 nm.setApplicationName(am.getApplicationName()); 434 if (am.getApplicationMode() != -Integer.MAX_VALUE) { 435 nm.setApplicationMode(new Integer (am.getApplicationMode())); 436 } 437 nm.setPackageId(am.getPackageId()); 438 nm.setProcessDefinitionId(am.getProcessDefinitionId()); 439 nm.setApplicationDefinitionId(am.getApplicationDefinitionId()); 440 return nm; 441 } 442 443 static org.enhydra.shark.api.client.wfservice.ParticipantMap fillParticipantMap(org.enhydra.shark.api.client.wfservice.ParticipantMap nm, 444 ParticipantMap pm) { 445 nm.setParticipantId(pm.getParticipantId()); 446 nm.setPackageId(pm.getPackageId()); 447 nm.setProcessDefinitionId(pm.getProcessDefinitionId()); 448 nm.setUsername(pm.getUsername()); 449 nm.setIsGroupUser(pm.getIsGroupUser()); 450 return nm; 451 } 452 453 static WfActivity makeWfActivity(WfActivityCORBA impl) { 454 WfActivity ret = null; 455 try { 456 byte[] o = rootPOA.activate_object(impl); 459 ret = WfActivityHelper.narrow(rootPOA.id_to_reference(o)); 460 461 } catch (ServantAlreadyActive servantAlreadyActive) { 462 servantAlreadyActive.printStackTrace(); 463 } catch (WrongPolicy wrongPolicy) { 464 wrongPolicy.printStackTrace(); 465 468 469 } catch (Exception ex) { 470 ex.printStackTrace(); 471 } 472 return ret; 473 } 474 475 static WfActivityIterator makeWfActivityIterator(WfActivityIteratorCORBA impl) { 476 WfActivityIterator ret = null; 477 try { 478 481 byte[] o = rootPOA.activate_object(impl); 482 ret = WfActivityIteratorHelper.narrow(rootPOA.id_to_reference(o)); 483 484 } catch (ServantAlreadyActive servantAlreadyActive) { 485 servantAlreadyActive.printStackTrace(); 486 } catch (WrongPolicy wrongPolicy) { 487 wrongPolicy.printStackTrace(); 488 491 492 } catch (Exception ex) { 493 ex.printStackTrace(); 494 } 495 return ret; 496 } 497 498 static WfAssignmentIterator makeWfAssignmentIterator(WfAssignmentIteratorCORBA impl) { 499 WfAssignmentIterator ret = null; 500 try { 501 byte[] o = rootPOA.activate_object(impl); 504 ret = WfAssignmentIteratorHelper.narrow(rootPOA.id_to_reference(o)); 505 506 } catch (ServantAlreadyActive servantAlreadyActive) { 507 servantAlreadyActive.printStackTrace(); 508 } catch (WrongPolicy wrongPolicy) { 509 wrongPolicy.printStackTrace(); 510 } catch (Exception ex) { 513 ex.printStackTrace(); 514 } 515 return ret; 516 } 517 518 static ApplicationMap makeApplicationMap(ApplicationMapCORBA impl) { 519 ApplicationMap ret = null; 520 try { 521 524 byte[] o = rootPOA.activate_object(impl); 525 ret = ApplicationMapHelper.narrow(rootPOA.id_to_reference(o)); 526 527 } catch (ServantAlreadyActive servantAlreadyActive) { 528 servantAlreadyActive.printStackTrace(); 529 } catch (WrongPolicy wrongPolicy) { 530 wrongPolicy.printStackTrace(); 531 } catch (Exception ex) { 534 ex.printStackTrace(); 535 } 536 return ret; 537 } 538 539 static WfEventAuditIterator makeWfEventAuditIterator(WfEventAuditIteratorCORBA impl) { 540 541 WfEventAuditIterator ret = null; 542 try { 543 546 byte[] o = rootPOA.activate_object(impl); 547 ret = WfEventAuditIteratorHelper.narrow(rootPOA.id_to_reference(o)); 548 549 } catch (ServantAlreadyActive servantAlreadyActive) { 550 servantAlreadyActive.printStackTrace(); 551 } catch (WrongPolicy wrongPolicy) { 552 wrongPolicy.printStackTrace(); 553 } catch (Exception ex) { 556 ex.printStackTrace(); 557 } 558 return ret; 559 } 560 561 static WfProcess makeWfProcess(WfProcessCORBA impl) { 562 WfProcess ret = null; 563 try { 564 byte[] b = rootPOA.activate_object(impl); 567 ret = WfProcessHelper.narrow(rootPOA.id_to_reference(b)); 568 569 } catch (ServantAlreadyActive servantAlreadyActive) { 570 servantAlreadyActive.printStackTrace(); 571 } catch (WrongPolicy wrongPolicy) { 572 wrongPolicy.printStackTrace(); 573 } catch (Exception ex) { 576 ex.printStackTrace(); 577 } 578 return ret; 579 } 580 581 static WfProcessIterator makeWfProcessIterator(WfProcessIteratorCORBA impl) { 582 WfProcessIterator ret = null; 583 try { 584 rootPOA.the_POAManager().activate(); 586 587 byte[] o = rootPOA.activate_object(impl); 588 ret = WfProcessIteratorHelper.narrow(rootPOA.id_to_reference(o)); 590 591 } catch (ServantAlreadyActive servantAlreadyActive) { 592 servantAlreadyActive.printStackTrace(); 593 } catch (WrongPolicy wrongPolicy) { 594 wrongPolicy.printStackTrace(); 595 598 599 } catch (Exception ex) { 600 ex.printStackTrace(); 601 } 602 return ret; 603 } 604 605 static WfProcessMgr makeWfProcessMgr(WfProcessMgrCORBA impl) { 606 WfProcessMgr ret = null; 607 try { 608 byte[] b = rootPOA.activate_object(impl); 611 ret = WfProcessMgrHelper.narrow(rootPOA.id_to_reference(b)); 614 615 } catch (ServantAlreadyActive servantAlreadyActive) { 616 servantAlreadyActive.printStackTrace(); 617 } catch (WrongPolicy wrongPolicy) { 618 wrongPolicy.printStackTrace(); 619 } catch (Exception ex) { 622 ex.printStackTrace(); 623 } 624 return ret; 625 } 626 627 static WfProcessMgrIterator makeWfProcessMgrIterator(WfProcessMgrIteratorCORBA impl) { 628 WfProcessMgrIterator ret = null; 629 try { 630 byte[] b = rootPOA.activate_object(impl); 633 ret = WfProcessMgrIteratorHelper.narrow(rootPOA.id_to_reference(b)); 634 } catch (ServantAlreadyActive servantAlreadyActive) { 635 servantAlreadyActive.printStackTrace(); 636 } catch (WrongPolicy wrongPolicy) { 637 wrongPolicy.printStackTrace(); 638 641 642 } catch (Exception ex) { 643 ex.printStackTrace(); 644 } 645 return ret; 646 } 647 648 static ParticipantMap makeParticipantMap(ParticipantMapCORBA impl) { 649 ParticipantMap ret = null; 650 try { 651 byte[] b = rootPOA.activate_object(impl); 654 ret = ParticipantMapHelper.narrow(rootPOA.id_to_reference(b)); 655 } catch (ServantAlreadyActive servantAlreadyActive) { 656 servantAlreadyActive.printStackTrace(); 657 } catch (WrongPolicy wrongPolicy) { 658 wrongPolicy.printStackTrace(); 659 } catch (Exception ex) { 662 ex.printStackTrace(); 663 } 664 return ret; 665 } 666 667 static WfRequester makeWfRequester(WfRequesterCORBA impl) { 668 WfRequester ret = null; 669 try { 670 673 byte[] o = rootPOA.activate_object(impl); 674 ret = org.omg.WorkflowModel.WfRequesterHelper.narrow(rootPOA.id_to_reference(o)); 675 } catch (ServantAlreadyActive servantAlreadyActive) { 676 servantAlreadyActive.printStackTrace(); 677 } catch (WrongPolicy wrongPolicy) { 678 wrongPolicy.printStackTrace(); 679 682 } catch (Exception ex) { 683 ex.printStackTrace(); 684 } 685 return ret; 686 } 687 688 static org.omg.WorkflowModel.WfResource makeWfResource( WfResourceCORBA impl) { 689 org.omg.WorkflowModel.WfResource ret = null; 690 try { 691 byte[] o = rootPOA.activate_object(impl); 694 ret = org.omg.WorkflowModel.WfResourceHelper.narrow(rootPOA.id_to_reference(o)); 696 } catch (ServantAlreadyActive servantAlreadyActive) { 698 servantAlreadyActive.printStackTrace(); 699 } catch (WrongPolicy wrongPolicy) { 700 wrongPolicy.printStackTrace(); 701 } catch (Exception ex) { 704 ex.printStackTrace(); 705 } 706 return ret; 707 } 708 709 static WfResourceIterator makeWfResourceIterator( WfResourceIteratorCORBA impl) { 710 WfResourceIterator ret = null; 711 try { 712 715 byte[] o = rootPOA.activate_object(impl); 716 ret = WfResourceIteratorHelper.narrow(rootPOA.id_to_reference(o)); 717 718 } catch (ServantAlreadyActive servantAlreadyActive) { 719 servantAlreadyActive.printStackTrace(); 720 } catch (WrongPolicy wrongPolicy) { 721 wrongPolicy.printStackTrace(); 722 725 } catch (Exception ex) { 726 ex.printStackTrace(); 727 } 728 return ret; 729 } 730 731 static WfAssignment makeWfAssignment(WfAssignmentCORBA impl) { 732 WfAssignment ret = null; 733 try { 734 737 byte[] o = rootPOA.activate_object(impl); 738 ret = WfAssignmentHelper.narrow(rootPOA.id_to_reference(o)); 739 740 } catch (ServantAlreadyActive servantAlreadyActive) { 741 servantAlreadyActive.printStackTrace(); 742 } catch (WrongPolicy wrongPolicy) { 743 wrongPolicy.printStackTrace(); 744 747 } catch (Exception ex) { 748 ex.printStackTrace(); 749 } 750 return ret; 751 } 752 } | Popular Tags |