1 23 package com.sun.enterprise.webservice; 24 25 import java.io.ByteArrayOutputStream ; 26 import java.io.ByteArrayInputStream ; 27 import java.io.OutputStreamWriter ; 28 import java.io.OutputStream ; 29 import java.io.InputStream ; 30 import java.io.File ; 31 32 import java.rmi.Remote ; 33 34 import com.sun.enterprise.deployment.WebServiceEndpoint; 35 import com.sun.enterprise.deployment.WebService; 36 import com.sun.enterprise.deployment.archivist.Archivist; 37 import com.sun.enterprise.Switch; 38 import com.sun.ejb.Container; 39 import com.sun.ejb.containers.StatelessSessionContainer; 40 import com.sun.ejb.Invocation; 41 import com.sun.enterprise.InvocationManager; 42 43 import com.sun.enterprise.security.jauth.ServerAuthConfig; 44 import com.sun.enterprise.webservice.WSSCallbackHandler; 45 46 import javax.xml.rpc.handler.MessageContext ; 47 import com.sun.xml.rpc.spi.runtime.Handler; 48 import com.sun.xml.rpc.spi.runtime.Tie; 49 50 import java.util.logging.Logger ; 51 import java.util.logging.Level ; 52 import com.sun.logging.LogDomains; 53 54 55 63 public class Ejb2RuntimeEndpointInfo extends EjbRuntimeEndpointInfo { 64 65 66 private Class tieClass; 67 68 private Tie tieInstance; 71 72 73 public Ejb2RuntimeEndpointInfo(WebServiceEndpoint webServiceEndpoint, 74 StatelessSessionContainer ejbContainer, 75 Object servant, Class tie) { 76 77 super(webServiceEndpoint, ejbContainer, servant); 78 tieClass = tie; 79 } 80 81 public Handler getHandlerImplementor(MessageContext msgContext) 82 throws Exception { 83 84 Invocation inv = new Invocation(); 90 91 inv.isWebService = true; 93 inv.container = container; 94 inv.messageContext = msgContext; 95 inv.transactionAttribute = Container.TX_NOT_INITIALIZED; 96 97 inv.securityPermissions = Container.SEC_NOT_INITIALIZED; 102 103 invManager.preInvoke(inv); 104 105 108 118 synchronized(this) { 123 if( tieInstance == null ) { 124 tieInstance = (Tie) tieClass.newInstance(); 125 tieInstance.setTarget((Remote ) webServiceEndpointServant); 126 } 127 } 128 129 inv.setWebServiceTie(tieInstance); 130 131 return (Handler) tieInstance; 132 } 133 134 140 public void releaseImplementor(Handler handler) { 141 try { 142 Invocation inv = (Invocation) invManager.getCurrentInvocation(); 143 144 154 if( inv != null ) { 155 if( inv.ejb != null ) { 156 container.postInvoke(inv); 157 } else { 158 invManager.postInvoke(inv); 159 } 160 } 161 } catch(Throwable t) { 162 logger.log(Level.FINE, "", t); 163 } 164 165 } 166 167 public EjbMessageDispatcher getMessageDispatcher() { 168 if (messageDispatcher==null) { 171 messageDispatcher = new EjbWebServiceDispatcher(); 172 } 173 return messageDispatcher; 174 } 175 } 176 | Popular Tags |