1 28 29 package com.caucho.ejb.session; 30 31 import com.caucho.ejb.AbstractContext; 32 import com.caucho.ejb.AbstractServer; 33 34 import javax.ejb.EJBObject ; 35 import javax.ejb.Handle ; 36 import javax.ejb.SessionContext ; 37 38 import javax.xml.rpc.handler.MessageContext ; 39 40 43 abstract public class AbstractSessionContext extends AbstractContext 44 implements SessionContext 45 { 46 protected final SessionServer _server; 47 48 private String _primaryKey; 49 private EJBObject _remote; 50 51 protected AbstractSessionContext(SessionServer server) 52 { 53 _server = server; 54 } 55 56 59 public AbstractServer getServer() 60 { 61 return _server; 62 } 63 64 67 public SessionServer getSessionServer() 68 { 69 return _server; 70 } 71 72 75 public Handle getHandle() 76 { 77 return getSessionServer().createHandle(this); 78 } 79 80 84 public EJBObject getEJBObject() 85 throws IllegalStateException 86 { 87 return getRemoteView(); 88 } 89 90 public String getPrimaryKey() 91 { 92 if (_primaryKey == null) 93 _primaryKey = getSessionServer().createSessionKey(this); 94 95 return _primaryKey; 96 } 97 98 public <T> T getBusinessObject(Class <T> businessInterface) 99 { 100 throw new UnsupportedOperationException (); 101 } 102 103 public Class getInvokedBusinessInterface() 104 { 105 throw new UnsupportedOperationException (); 106 } 107 108 public MessageContext getMessageContext() 109 { 110 throw new UnsupportedOperationException (); 111 } 112 } 113 | Popular Tags |