1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder; 27 28 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util.CannotResolveReferenceException; 29 import org.omg.CORBA.Object ; 30 import org.omg.Components.AlreadyConnected; 31 import org.omg.Components.CCMObject; 32 import org.omg.Components.Cookie; 33 import org.omg.Components.CookieRequired; 34 import org.omg.Components.ExceededConnectionLimit; 35 import org.omg.Components.InvalidConnection; 36 import org.omg.Components.InvalidName; 37 import org.omg.Components.NoConnection; 38 39 47 public class UsesportDeployer 48 extends UsesportDeployerContext 49 { 50 private Cookie cookie; 56 private CCMObject user; 57 79 public org.omg.Components.CCMObject 80 getCCMobjectUser () 81 throws CannotResolveReferenceException 82 83 { 84 if(getComponentinstantiationDeployer()!=null) 85 return getComponentinstantiationDeployer().getComponent(); 86 return org.omg.Components. 87 CCMObjectHelper.narrow(getFindbyDeployer().resolveReference()); 88 } 89 90 103 public Cookie 104 establishConnection(Object providedObject) 105 throws CannotResolveReferenceException, 106 InvalidName, 107 InvalidConnection, 108 AlreadyConnected, 109 ExceededConnectionLimit 110 { 111 user=getCCMobjectUser(); 112 cookie=user.connect(getUsesport().getUsesidentifier().getValue(),providedObject); 113 getLifeCycleManager().stepEndedSuccessFully(); 114 return cookie; 115 } 116 117 125 public void 126 breakConnection() 127 throws InvalidName, 128 InvalidConnection, 129 CookieRequired, 130 NoConnection 131 { 132 user.disconnect(getUsesport().getUsesidentifier().getValue(),cookie); 133 getLifeCycleManager().stepEndedSuccessFully(); 134 } 135 } 136 | Popular Tags |