You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2011/07/10 06:34:03 UTC

svn commit: r1144777 [5/16] - /openejb/site/trunk/content/

Added: openejb/site/trunk/content/ejbcontext-whiteboard.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/ejbcontext-whiteboard.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/ejbcontext-whiteboard.cwiki (added)
+++ openejb/site/trunk/content/ejbcontext-whiteboard.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,387 @@
+{code:title=CoreContext.java}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.core;
+
+import java.util.List;
+import javax.ejb.EJBHome;
+import javax.ejb.EJBLocalHome;
+import javax.ejb.EJBLocalObject;
+import javax.ejb.TimerService;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.transaction.Status;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+import java.util.List;
+
+import org.apache.openejb.DeploymentInfo;
+import org.apache.openejb.InterfaceType;
+import org.apache.openejb.RpcContainer;
+import org.apache.openejb.InternalErrorException;
+import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
+import org.apache.openejb.core.ivm.IntraVmProxy;
+import org.apache.openejb.spi.SecurityService;
+import org.apache.openejb.util.proxy.ProxyManager;
+
+
+public abstract class CoreContext implements java.io.Serializable {
+
+    public static enum Call {
+        getEJBHome,
+        getCallerPrincipal,
+        getRollbackOnly,
+        isCallerInRole,
+        setRollbackOnly,
+        getEJBObject,
+        getPrimaryKey,
+        getUserTransaction
+    }
+
+    private final UserTransaction userTransaction;
+    private final SecurityService securityService;
+    private final TransactionManager transactionManager;
+
+    public CoreContext(TransactionManager transactionManager, SecurityService securityService) {
+        this.transactionManager = transactionManager;
+        this.securityService = securityService;
+        this.userTransaction = new CoreUserTransaction(transactionManager);
+    }
+
+    protected CoreContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
+        this.transactionManager = transactionManager;
+        this.securityService = securityService;
+        this.userTransaction = userTransaction;
+    }
+
+    private TransactionManager getTransactionManager() {
+        return transactionManager;
+    }
+
+    public abstract void checkBeanState(Call methodCategory) throws IllegalStateException;
+
+    public java.security.Principal getCallerPrincipal() {
+        checkBeanState(Call.getCallerPrincipal);
+        Object securityIdentity = ThreadContext.getThreadContext().getSecurityIdentity();
+        return (java.security.Principal) getSecurityService().translateTo(securityIdentity, java.security.Principal.class);
+    }
+
+    private SecurityService getSecurityService() {
+        return securityService;
+    }
+
+    public boolean isCallerInRole(java.lang.String roleName) {
+        checkBeanState(Call.isCallerInRole);
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.core.CoreDeploymentInfo di = (org.apache.openejb.core.CoreDeploymentInfo) threadContext.getDeploymentInfo();
+        List<String> physicalRoles = di.getPhysicalRole(roleName);
+        Object caller = threadContext.getSecurityIdentity();
+        return securityService.isCallerAuthorized(caller, physicalRoles);
+    }
+
+    public EJBHome getEJBHome() {
+        checkBeanState(Call.getEJBHome);
+
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.core.CoreDeploymentInfo di = (org.apache.openejb.core.CoreDeploymentInfo) threadContext.getDeploymentInfo();
+
+        return di.getEJBHome();
+    }
+
+    public javax.ejb.EJBObject getEJBObject() {
+        checkBeanState(Call.getEJBObject);
+
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.DeploymentInfo di = threadContext.getDeploymentInfo();
+
+        EjbObjectProxyHandler handler = newEjbObjectHandler((RpcContainer) di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(), InterfaceType.EJB_OBJECT);
+        Object newProxy = null;
+        try {
+            Class[] interfaces = new Class[]{di.getRemoteInterface(), org.apache.openejb.core.ivm.IntraVmProxy.class};
+            newProxy = ProxyManager.newProxyInstance(interfaces, handler);
+        } catch (IllegalAccessException iae) {
+            throw new RuntimeException("Could not create IVM proxy for " + di.getRemoteInterface() + " interface");
+        }
+        return (javax.ejb.EJBObject) newProxy;
+    }
+
+    public EJBLocalObject getEJBLocalObject() {
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.DeploymentInfo di = threadContext.getDeploymentInfo();
+
+        EjbObjectProxyHandler handler = newEjbObjectHandler((RpcContainer) di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(), InterfaceType.EJB_LOCAL);
+        handler.setLocal(true);
+        Object newProxy = null;
+        try {
+            Class[] interfaces = new Class[]{di.getLocalInterface(), org.apache.openejb.core.ivm.IntraVmProxy.class};
+            newProxy = ProxyManager.newProxyInstance(interfaces, handler);
+        } catch (IllegalAccessException iae) {
+            throw new RuntimeException("Could not create IVM proxy for " + di.getLocalInterface() + " interface");
+        }
+        return (EJBLocalObject) newProxy;
+    }
+
+    public Object getBusinessObject(Class interfce) {
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        DeploymentInfo di = threadContext.getDeploymentInfo();
+
+        InterfaceType interfaceType;
+        if (di.getBusinessLocalInterface() != null && di.getBusinessLocalInterface().getName().equals(interfce.getName())) {
+            interfaceType = InterfaceType.BUSINESS_LOCAL;
+        } else if (di.getBusinessRemoteInterface() != null && di.getBusinessRemoteInterface().getName().equals(interfce.getName())) {
+            interfaceType = InterfaceType.BUSINESS_REMOTE;
+        } else {
+            throw new IllegalArgumentException("Component has no such interface " + interfce.getName());
+        }
+
+        Object newProxy;
+        try {
+            EjbObjectProxyHandler handler = newEjbObjectHandler((RpcContainer) di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(), interfaceType);
+            Class[] interfaces = new Class[]{interfce, IntraVmProxy.class};
+            newProxy = ProxyManager.newProxyInstance(interfaces, handler);
+        } catch (IllegalAccessException iae) {
+            throw new InternalErrorException("Could not create IVM proxy for " + interfce.getName() + " interface", iae);
+        }
+        return newProxy;
+    }
+
+    public EJBLocalHome getEJBLocalHome() {
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.core.CoreDeploymentInfo di = threadContext.getDeploymentInfo();
+
+        return di.getEJBLocalHome();
+    }
+
+    public TimerService getTimerService() {
+        return null;
+    }
+
+    public Object getPrimaryKey() {
+        /*
+        * This method is only declared in the EntityContext interface and is therefor
+        * unavailable in the SessionContext and doesn't not require a check for bean kind (Entity vs Session).
+        */
+        checkBeanState(Call.getPrimaryKey);
+
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        return threadContext.getPrimaryKey();
+    }
+
+    public boolean getRollbackOnly() {
+
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.DeploymentInfo di = threadContext.getDeploymentInfo();
+        if (di.isBeanManagedTransaction()) {
+            throw new IllegalStateException("bean-managed transaction beans can not access the getRollbackOnly( ) method");
+        }
+
+        checkBeanState(Call.getRollbackOnly);
+        try {
+            int status = getTransactionManager().getStatus();
+            if (status == Status.STATUS_MARKED_ROLLBACK || status == Status.STATUS_ROLLEDBACK) {
+                return true;
+            } else if (status == Status.STATUS_NO_TRANSACTION) {
+                // this would be true for Supports tx attribute where no tx was propagated
+                throw new IllegalStateException("No current transaction");
+            } else {
+                return false;
+            }
+        } catch (javax.transaction.SystemException se) {
+            throw new RuntimeException("Transaction service has thrown a SystemException");
+        }
+    }
+
+    public void setRollbackOnly() {
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.DeploymentInfo di = threadContext.getDeploymentInfo();
+        if (di.isBeanManagedTransaction()) {
+            throw new IllegalStateException("bean-managed transaction beans can not access the setRollbackOnly( ) method");
+        }
+
+        checkBeanState(Call.setRollbackOnly);
+
+        try {
+            getTransactionManager().setRollbackOnly();
+        } catch (javax.transaction.SystemException se) {
+            throw new RuntimeException("Transaction service has thrown a SystemException");
+        }
+
+    }
+
+    public javax.transaction.UserTransaction getUserTransaction() {
+
+        ThreadContext threadContext = ThreadContext.getThreadContext();
+        org.apache.openejb.DeploymentInfo di = threadContext.getDeploymentInfo();
+        if (di.isBeanManagedTransaction()) {
+            checkBeanState(Call.getUserTransaction);
+            return userTransaction;
+        } else {
+            throw new java.lang.IllegalStateException("container-managed transaction beans can not access the UserTransaction");
+        }
+    }
+
+    /**
+     * Lookup a resource within the component's private naming context.
+     *
+     * @param name - Name of the entry (relative to java:comp/env).
+     * @return The looked-up object.
+     * @see http://java.sun.com/javaee/5/docs/api/javax/ejb/EJBContext.html#lookup(java.lang.String)
+     * @see EJB3.0 "Core Contracts and Requirements", section 4.5.2, table 2.
+     */
+    public Object lookup(String name) {
+        Context initialContext = null;
+        Object object = null;
+
+        try {
+            initialContext = new InitialContext();
+            object = initialContext.lookup("java:comp/env/" + name);
+        } catch (NamingException nex) {
+            throw new IllegalArgumentException(nex);
+        }
+        return object;
+    }
+
+    /*----------------------------------------------------*/
+    /* UNSUPPORTED DEPRICATED METHODS                     */
+    /*----------------------------------------------------*/
+
+    public boolean isCallerInRole(java.security.Identity role) {
+        throw new java.lang.UnsupportedOperationException();
+    }
+
+    public java.security.Identity getCallerIdentity() {
+        throw new java.lang.UnsupportedOperationException();
+    }
+
+    public java.util.Properties getEnvironment() {
+        throw new java.lang.UnsupportedOperationException();
+    }
+
+    protected abstract EjbObjectProxyHandler newEjbObjectHandler(RpcContainer container, Object pk, Object depID, InterfaceType interfaceType);
+}
+{code}
+
+{code:title=EntityContext.java}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.core.entity;
+
+import org.apache.openejb.RpcContainer;
+import org.apache.openejb.InterfaceType;
+import org.apache.openejb.spi.SecurityService;
+import org.apache.openejb.core.ThreadContext;
+import org.apache.openejb.core.Operation;
+import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
+
+import javax.transaction.TransactionManager;
+
+public class EntityContext extends org.apache.openejb.core.CoreContext implements javax.ejb.EntityContext {
+
+    public EntityContext(TransactionManager transactionManager, SecurityService securityService) {
+        super(transactionManager, securityService);
+    }
+
+    public void checkBeanState(Call methodCategory) throws IllegalStateException {
+        /*
+        The super class, CoreContext determines if Context.getUserTransaction( ) method
+        maybe called before invoking this.checkBeanState( ).  Only "bean managed" transaction
+        beans may access this method.
+
+        The USER_TRANSACTION_METHOD constant will never be a methodCategory
+        because entity beans are not allowed to have "bean managed" transactions.
+
+        USER_TRANSACTION_METHOD:
+        */
+
+        ThreadContext callContext = ThreadContext.getThreadContext();
+        org.apache.openejb.DeploymentInfo di = callContext.getDeploymentInfo();
+
+        Operation currentOperation = callContext.getCurrentOperation();
+        switch (currentOperation) {
+            case SET_CONTEXT:
+            case UNSET_CONTEXT:
+                switch(methodCategory){
+                    case getCallerPrincipal:
+                    case getRollbackOnly:
+                    case isCallerInRole:
+                    case setRollbackOnly:
+                    case getEJBObject:
+                    case getPrimaryKey:
+                    case getUserTransaction:
+                        throw new IllegalStateException(methodCategory + "cannot be called in " + currentOperation);
+                }
+                break;
+
+            case CREATE:
+            case FIND:
+            case HOME:
+                switch(methodCategory){
+                    case getEJBObject:
+                    case getPrimaryKey:
+                    case getUserTransaction:
+                        throw new IllegalStateException(methodCategory + "cannot be called in " + currentOperation);
+                }
+                break;
+
+            case ACTIVATE:
+            case PASSIVATE:
+                switch(methodCategory){
+                    case getCallerPrincipal:
+                    case getRollbackOnly:
+                    case isCallerInRole:
+                    case setRollbackOnly:
+                    case getUserTransaction:
+                        throw new IllegalStateException(methodCategory + "cannot be called in " + currentOperation);
+                }
+                break;
+
+            case POST_CREATE:
+            case REMOVE:
+            case LOAD:
+            case STORE:
+                switch(methodCategory){
+                    case getUserTransaction:
+                        throw new IllegalStateException(methodCategory + "cannot be called in " + currentOperation);
+                }
+                break;
+
+        }
+
+    }
+
+    protected EjbObjectProxyHandler newEjbObjectHandler(RpcContainer container, Object pk, Object depID, InterfaceType interfaceType) {
+        return new EntityEjbObjectHandler(container, pk, depID, interfaceType);
+    }
+
+}
+{code}
+

Propchange: openejb/site/trunk/content/ejbcontext-whiteboard.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/ejbcontext-whiteboard.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/ejbcontext-whiteboard.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/ejbcontext-whiteboard.mdtext (added)
+++ openejb/site/trunk/content/ejbcontext-whiteboard.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,447 @@
+Title: EjbContext Whiteboard
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>CoreContext.java</B></DIV><DIV class="codeContent panelContent">
+    /**
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    package org.apache.openejb.core;
+    
+    import java.util.List;
+    import javax.ejb.EJBHome;
+    import javax.ejb.EJBLocalHome;
+    import javax.ejb.EJBLocalObject;
+    import javax.ejb.TimerService;
+    import javax.naming.Context;
+    import javax.naming.InitialContext;
+    import javax.naming.NamingException;
+    import javax.transaction.Status;
+    import javax.transaction.TransactionManager;
+    import javax.transaction.UserTransaction;
+    import java.util.List;
+    
+    import org.apache.openejb.DeploymentInfo;
+    import org.apache.openejb.InterfaceType;
+    import org.apache.openejb.RpcContainer;
+    import org.apache.openejb.InternalErrorException;
+    import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
+    import org.apache.openejb.core.ivm.IntraVmProxy;
+    import org.apache.openejb.spi.SecurityService;
+    import org.apache.openejb.util.proxy.ProxyManager;
+    
+    
+    public abstract class CoreContext implements java.io.Serializable {
+    
+        public static enum Call {
+    	getEJBHome,
+    	getCallerPrincipal,
+    	getRollbackOnly,
+    	isCallerInRole,
+    	setRollbackOnly,
+    	getEJBObject,
+    	getPrimaryKey,
+    	getUserTransaction
+        }
+    
+        private final UserTransaction userTransaction;
+        private final SecurityService securityService;
+        private final TransactionManager transactionManager;
+    
+        public CoreContext(TransactionManager transactionManager,
+SecurityService securityService) {
+    	this.transactionManager = transactionManager;
+    	this.securityService = securityService;
+    	this.userTransaction = new CoreUserTransaction(transactionManager);
+        }
+    
+        protected CoreContext(TransactionManager transactionManager,
+SecurityService securityService, UserTransaction userTransaction) {
+    	this.transactionManager = transactionManager;
+    	this.securityService = securityService;
+    	this.userTransaction = userTransaction;
+        }
+    
+        private TransactionManager getTransactionManager() {
+    	return transactionManager;
+        }
+    
+        public abstract void checkBeanState(Call methodCategory) throws
+IllegalStateException;
+    
+        public java.security.Principal getCallerPrincipal() {
+    	checkBeanState(Call.getCallerPrincipal);
+    	Object securityIdentity =
+ThreadContext.getThreadContext().getSecurityIdentity();
+    	return (java.security.Principal)
+getSecurityService().translateTo(securityIdentity,
+java.security.Principal.class);
+        }
+    
+        private SecurityService getSecurityService() {
+    	return securityService;
+        }
+    
+        public boolean isCallerInRole(java.lang.String roleName) {
+    	checkBeanState(Call.isCallerInRole);
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.core.CoreDeploymentInfo di =
+(org.apache.openejb.core.CoreDeploymentInfo)
+threadContext.getDeploymentInfo();
+    	List<String> physicalRoles = di.getPhysicalRole(roleName);
+    	Object caller = threadContext.getSecurityIdentity();
+    	return securityService.isCallerAuthorized(caller, physicalRoles);
+        }
+    
+        public EJBHome getEJBHome() {
+    	checkBeanState(Call.getEJBHome);
+    
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.core.CoreDeploymentInfo di =
+(org.apache.openejb.core.CoreDeploymentInfo)
+threadContext.getDeploymentInfo();
+    
+    	return di.getEJBHome();
+        }
+    
+        public javax.ejb.EJBObject getEJBObject() {
+    	checkBeanState(Call.getEJBObject);
+    
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.DeploymentInfo di =
+threadContext.getDeploymentInfo();
+    
+    	EjbObjectProxyHandler handler = newEjbObjectHandler((RpcContainer)
+di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(),
+InterfaceType.EJB_OBJECT);
+    	Object newProxy = null;
+    	try {
+                Class[]
+ interfaces = new Class[]{di.getRemoteInterface(),
+org.apache.openejb.core.ivm.IntraVmProxy.class};
+    	    newProxy = ProxyManager.newProxyInstance(interfaces, handler);
+    	} catch (IllegalAccessException iae) {
+    	    throw new RuntimeException("Could not create IVM proxy for " +
+di.getRemoteInterface() + " interface");
+    	}
+    	return (javax.ejb.EJBObject) newProxy;
+        }
+    
+        public EJBLocalObject getEJBLocalObject() {
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.DeploymentInfo di =
+threadContext.getDeploymentInfo();
+    
+    	EjbObjectProxyHandler handler = newEjbObjectHandler((RpcContainer)
+di.getContainer(), threadContext.getPrimaryKey(), di.getDeploymentID(),
+InterfaceType.EJB_LOCAL);
+    	handler.setLocal(true);
+    	Object newProxy = null;
+    	try {
+                Class[]
+ interfaces = new Class[]{di.getLocalInterface(),
+org.apache.openejb.core.ivm.IntraVmProxy.class};
+    	    newProxy = ProxyManager.newProxyInstance(interfaces, handler);
+    	} catch (IllegalAccessException iae) {
+    	    throw new RuntimeException("Could not create IVM proxy for " +
+di.getLocalInterface() + " interface");
+    	}
+    	return (EJBLocalObject) newProxy;
+        }
+    
+        public Object getBusinessObject(Class interfce) {
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	DeploymentInfo di = threadContext.getDeploymentInfo();
+    
+    	InterfaceType interfaceType;
+    	if (di.getBusinessLocalInterface() != null &&
+di.getBusinessLocalInterface().getName().equals(interfce.getName())) {
+    	    interfaceType = InterfaceType.BUSINESS_LOCAL;
+    	} else if (di.getBusinessRemoteInterface() != null &&
+di.getBusinessRemoteInterface().getName().equals(interfce.getName())) {
+    	    interfaceType = InterfaceType.BUSINESS_REMOTE;
+    	} else {
+    	    throw new IllegalArgumentException("Component has no such
+interface " + interfce.getName());
+    	}
+    
+    	Object newProxy;
+    	try {
+    	    EjbObjectProxyHandler handler =
+newEjbObjectHandler((RpcContainer) di.getContainer(),
+threadContext.getPrimaryKey(), di.getDeploymentID(), interfaceType);
+                Class[]
+ interfaces = new Class[]{interfce, IntraVmProxy.class};
+    	    newProxy = ProxyManager.newProxyInstance(interfaces, handler);
+    	} catch (IllegalAccessException iae) {
+    	    throw new InternalErrorException("Could not create IVM proxy
+for " + interfce.getName() + " interface", iae);
+    	}
+    	return newProxy;
+        }
+    
+        public EJBLocalHome getEJBLocalHome() {
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.core.CoreDeploymentInfo di =
+threadContext.getDeploymentInfo();
+    
+    	return di.getEJBLocalHome();
+        }
+    
+        public TimerService getTimerService() {
+    	return null;
+        }
+    
+        public Object getPrimaryKey() {
+    	/*
+    	* This method is only declared in the EntityContext interface and
+is therefor
+    	* unavailable in the SessionContext and doesn't not require a check
+for bean kind (Entity vs Session).
+    	*/
+    	checkBeanState(Call.getPrimaryKey);
+    
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	return threadContext.getPrimaryKey();
+        }
+    
+        public boolean getRollbackOnly() {
+    
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.DeploymentInfo di =
+threadContext.getDeploymentInfo();
+    	if (di.isBeanManagedTransaction()) {
+    	    throw new IllegalStateException("bean-managed transaction beans
+can not access the getRollbackOnly( ) method");
+    	}
+    
+    	checkBeanState(Call.getRollbackOnly);
+    	try {
+    	    int status = getTransactionManager().getStatus();
+    	    if (status == Status.STATUS_MARKED_ROLLBACK || status ==
+Status.STATUS_ROLLEDBACK) {
+    		return true;
+    	    } else if (status == Status.STATUS_NO_TRANSACTION) {
+    		// this would be true for Supports tx attribute where no tx
+was propagated
+    		throw new IllegalStateException("No current transaction");
+    	    } else {
+    		return false;
+    	    }
+    	} catch (javax.transaction.SystemException se) {
+    	    throw new RuntimeException("Transaction service has thrown a
+SystemException");
+    	}
+        }
+    
+        public void setRollbackOnly() {
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.DeploymentInfo di =
+threadContext.getDeploymentInfo();
+    	if (di.isBeanManagedTransaction()) {
+    	    throw new IllegalStateException("bean-managed transaction beans
+can not access the setRollbackOnly( ) method");
+    	}
+    
+    	checkBeanState(Call.setRollbackOnly);
+    
+    	try {
+    	    getTransactionManager().setRollbackOnly();
+    	} catch (javax.transaction.SystemException se) {
+    	    throw new RuntimeException("Transaction service has thrown a
+SystemException");
+    	}
+    
+        }
+    
+        public javax.transaction.UserTransaction getUserTransaction() {
+    
+    	ThreadContext threadContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.DeploymentInfo di =
+threadContext.getDeploymentInfo();
+    	if (di.isBeanManagedTransaction()) {
+    	    checkBeanState(Call.getUserTransaction);
+    	    return userTransaction;
+    	} else {
+    	    throw new java.lang.IllegalStateException("container-managed
+transaction beans can not access the UserTransaction");
+    	}
+        }
+    
+        /**
+         * Lookup a resource within the component's private naming context.
+         *
+         * @param name - Name of the entry (relative to java:comp/env).
+         * @return The looked-up object.
+         * @see
+http://java.sun.com/javaee/5/docs/api/javax/ejb/EJBContext.html#lookup(java.lang.String)
+         * @see EJB3.0 "Core Contracts and Requirements", section 4.5.2, table
+2.
+         */
+        public Object lookup(String name) {
+    	Context initialContext = null;
+    	Object object = null;
+    
+    	try {
+    	    initialContext = new InitialContext();
+    	    object = initialContext.lookup("java:comp/env/" + name);
+    	} catch (NamingException nex) {
+    	    throw new IllegalArgumentException(nex);
+    	}
+    	return object;
+        }
+    
+        /*----------------------------------------------------*/
+        /* UNSUPPORTED DEPRICATED METHODS			  */
+        /*----------------------------------------------------*/
+    
+        public boolean isCallerInRole(java.security.Identity role) {
+    	throw new java.lang.UnsupportedOperationException();
+        }
+    
+        public java.security.Identity getCallerIdentity() {
+    	throw new java.lang.UnsupportedOperationException();
+        }
+    
+        public java.util.Properties getEnvironment() {
+    	throw new java.lang.UnsupportedOperationException();
+        }
+    
+        protected abstract EjbObjectProxyHandler
+newEjbObjectHandler(RpcContainer container, Object pk, Object depID,
+InterfaceType interfaceType);
+    }
+
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>EntityContext.java</B></DIV><DIV class="codeContent panelContent">
+    /**
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    package org.apache.openejb.core.entity;
+    
+    import org.apache.openejb.RpcContainer;
+    import org.apache.openejb.InterfaceType;
+    import org.apache.openejb.spi.SecurityService;
+    import org.apache.openejb.core.ThreadContext;
+    import org.apache.openejb.core.Operation;
+    import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
+    
+    import javax.transaction.TransactionManager;
+    
+    public class EntityContext extends org.apache.openejb.core.CoreContext
+implements javax.ejb.EntityContext {
+    
+        public EntityContext(TransactionManager transactionManager,
+SecurityService securityService) {
+    	super(transactionManager, securityService);
+        }
+    
+        public void checkBeanState(Call methodCategory) throws
+IllegalStateException {
+    	/*
+    	The super class, CoreContext determines if
+Context.getUserTransaction( ) method
+    	maybe called before invoking this.checkBeanState( ).  Only "bean
+managed" transaction
+    	beans may access this method.
+    
+    	The USER_TRANSACTION_METHOD constant will never be a methodCategory
+    	because entity beans are not allowed to have "bean managed"
+transactions.
+    
+    	USER_TRANSACTION_METHOD:
+    	*/
+    
+    	ThreadContext callContext = ThreadContext.getThreadContext();
+    	org.apache.openejb.DeploymentInfo di =
+callContext.getDeploymentInfo();
+    
+    	Operation currentOperation = callContext.getCurrentOperation();
+    	switch (currentOperation) {
+    	    case SET_CONTEXT:
+    	    case UNSET_CONTEXT:
+    		switch(methodCategory){
+    		    case getCallerPrincipal:
+    		    case getRollbackOnly:
+    		    case isCallerInRole:
+    		    case setRollbackOnly:
+    		    case getEJBObject:
+    		    case getPrimaryKey:
+    		    case getUserTransaction:
+    			throw new IllegalStateException(methodCategory +
+"cannot be called in " + currentOperation);
+    		}
+    		break;
+    
+    	    case CREATE:
+    	    case FIND:
+    	    case HOME:
+    		switch(methodCategory){
+    		    case getEJBObject:
+    		    case getPrimaryKey:
+    		    case getUserTransaction:
+    			throw new IllegalStateException(methodCategory +
+"cannot be called in " + currentOperation);
+    		}
+    		break;
+    
+    	    case ACTIVATE:
+    	    case PASSIVATE:
+    		switch(methodCategory){
+    		    case getCallerPrincipal:
+    		    case getRollbackOnly:
+    		    case isCallerInRole:
+    		    case setRollbackOnly:
+    		    case getUserTransaction:
+    			throw new IllegalStateException(methodCategory +
+"cannot be called in " + currentOperation);
+    		}
+    		break;
+    
+    	    case POST_CREATE:
+    	    case REMOVE:
+    	    case LOAD:
+    	    case STORE:
+    		switch(methodCategory){
+    		    case getUserTransaction:
+    			throw new IllegalStateException(methodCategory +
+"cannot be called in " + currentOperation);
+    		}
+    		break;
+    
+    	}
+    
+        }
+    
+        protected EjbObjectProxyHandler newEjbObjectHandler(RpcContainer
+container, Object pk, Object depID, InterfaceType interfaceType) {
+    	return new EntityEjbObjectHandler(container, pk, depID,
+interfaceType);
+        }
+    
+    }
+
+

Added: openejb/site/trunk/content/embedded.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/embedded.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/embedded.cwiki (added)
+++ openejb/site/trunk/content/embedded.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+{include:Local Server}
\ No newline at end of file

Propchange: openejb/site/trunk/content/embedded.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/embedded.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/embedded.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/embedded.mdtext (added)
+++ openejb/site/trunk/content/embedded.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,2 @@
+Title: Embedded
+{include:Local Server}

Added: openejb/site/trunk/content/embedding-openejb.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/embedding-openejb.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/embedding-openejb.cwiki (added)
+++ openejb/site/trunk/content/embedding-openejb.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,258 @@
+OpenEJB embedded in your app, server, IDE, or JUnit
+h1. Say what?! A local server?
+
+
+Yes, you read correctly. OpenEJB can be embedded and treated as your very own personal EJB container.
+
+If they can have Local and Remote EJB's, why not Local and Remote EJB Servers too?
+
+Haven't you ever wanted EJBs without the heavy? I mean you need the "heavy" eventually, but not while you're developing. Well, there's the advantage of an EJB implementation that was designed with a very clean and well defined server-container contract, you can cut the server part out completely!
+
+So, if you wish to access ejbs locally and not in client/server mode, you can do so by embedding OpenEJB as a library and accessing ejbs through OpenEJB's built-in IntraVM (Local) Server. Why would someone want to do this?
+* Your application is a server or other middleware
+* You want to write an app that can be both stand alonedistributed
+* To test your EJBs with JUnit and don't want to start/stop servers and other nonsense
+* Imagine the power from being able to use your IDE debugger to step from your Client all the way into your EJB and back with no remote debugging voodoo.
+
+
+In this case, your application, test suite, IDE, or client accesses beans as you would from any other EJB Server. The EJB Server just happens to be running in the same virtual machine as your application. This EJB Server is thusly called the IntraVM Server, and, for all intense purposes, your application an IntraVM Client.
+
+There are some interesting differences though. The IntraVM Server isn't a heavyweight server as one normally associates with EJB. It doesn't open connections, launch threads for processing requests, introduce complex classloading heirarchies, or any of those "heavy" kind of things. All it does is dish out proxies to your app that can be used to shoot calls right into the EJB Container. Very light, very fast, very easy for testing, debugging, developing, etc.
+
+h1. Accessing EJBs locally
+
+
+Try something like this for a simple IntraVM (Local) Client:
+
+
+{code:title=c:\my\app\MyEjbApplication.java}
+import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+import FooHome;
+
+public class MyEjbApplication {
+
+public static void main( String args[]) {
+  try{
+    
+    Properties properties = new Properties();
+    
+    properties.put(Context.INITIAL_CONTEXT_FACTORY, 
+        "org.openejb.client.LocalInitialContextFactory");
+    
+    InitialContext ctx = new InitialContext(properties);
+    
+    Object obj = ctx.lookup("my/bean/Foo");
+    
+    FooHome ejbHome = (FooHome)
+        PortableRemoteObject.narrow(obj, FooHome.class);
+  
+  } catch (Exception e){
+    e.printStackTRace();
+  }
+}
+}
+{code}
+
+
+
+That would be the simplest spec compliant client you could create. If you don't care about spec compliance and just want to "cheat", you can do this:
+
+
+{code:title=c:\my\app\MyEjbApplication.java}
+import javax.naming.InitialContext;
+import FooHome;
+
+public class MyEjbApplication {
+
+public static void main( String args[]) {
+  try{
+    
+    FooHome ejbHome = (FooHome)new InitialContext().lookup(
+                            "java:openejb/ejb/my/bean/Foo");
+  
+  } catch (Exception e){
+    e.printStackTRace();
+  }
+}
+}
+{code}
+
+
+
+Now keep in mind, that is not spec compliant. Also keep in mind that we provide it as a convenience, so if there is something you don't like or think should be changed, send code.
+
+h1. Passing initialization parameters
+
+
+When accessing OpenEJB in local (intra-vm) mode, the IntraVM server will instantiate OpenEJB for you. When it instantiates OpenEJB, it puts default values for the items in the Properties object OpenEJB needs to actually instantiate.
+
+If you want to pass OpenEJB specific parameters, you can do this in two ways:* Call init yourself before any JNDI calls are made
+* Pass the parameters in the InitialContext hashtable
+
+
+Refer to the [OpenEJB Specification|spec.html#openejb.api] for information on the init method or the parameters you can pass to OpenEJB.
+
+Here is an example of passing the initialization parameters in to OpenEJB via the first InitialContext creation. I stress, this is only applicable the very first time and InitialContext is created within your Virtual Machine. After that, OpenEJB will have been initialized and the parameters will be ignored.
+
+
+{code:title=c:\my\app\MyEjbApplication.java}
+import FooHome;
+import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+
+public class MyEjbApplication {
+
+public static void main( String args[]) {
+  try{
+    
+    Properties p = new Properties();
+    
+    p.put(Context.INITIAL_CONTEXT_FACTORY, 
+          "org.openejb.client.LocalInitialContextFactory");
+    
+    p.put("openejb.home", "c:\\dir\\openejb");
+    
+    p.put("openejb.configuration", 
+          "c:\\my\\app\\conf\\openejb.conf");
+    
+    InitialContext ctx = new InitialContext( p );
+    
+    Object obj = ctx.lookup("my/bean/Foo");
+    
+    FooHome ejbHome = (FooHome)
+        PortableRemoteObject.narrow(obj,FooHome.class);
+  
+  } catch (Exception e){
+    e.printStackTRace();
+  }
+}
+}
+{code}
+
+
+
+h1. Set the openejb.home variable
+
+
+If you use OpenEJB Local Server, you are actually using OpenEJB as an embedded library. This means when your application starts, OpenEJB will be starting too, in your virtual machine. Odds are you will not want to execute your application in the directory where OpenEJB was installed, but will want to execute your application where you are developing it. This is fine, but you will need to tell OpenEJB where it was installed. To do this, set the "openejb.home" system variable.
+
+For example, if OpenEJB was unpacked in the directory in c:\dir\openejb, you can set the openejb.home variable as a java vm flag as follows.
+
+{{c:\my\app> java -Dopenejb.home=c:\dir\openejb MyEjbApplication}}
+
+
+You can also set the openejb.home variable by calling System.setProperty(...) in your application before any calls to the OpenEJB Local Server are made.
+
+
+{code:title=c:\my\app\MyEjbApplication.java}
+...
+public static void main(String args[]) {
+    
+  System.setProperty("openejb.home", "c:\\dir\\openejb");
+  ...
+  
+}
+...
+{code}
+
+
+
+As mentioned above, you can pass OpenEJB parameters on your first call to the Local Server.
+
+
+{code:title=c:\my\app\MyEjbApplication.java}
+...
+public static void main( String args[]) {
+    
+  Properties p = new Properties();
+  
+  p.put(Context.INITIAL_CONTEXT_FACTORY, 
+        "org.openejb.client.LocalInitialContextFactory");
+  
+  p.put("openejb.home", "c:\\dir\\openejb");
+      
+  InitialContext ctx = new InitialContext( p );
+  ...
+}
+...
+{code}
+
+
+
+When OpenEJB is started, it will look for its configuration files in the OPENJB_HOME/conf directory. The paths to beans in your openejb.conf file are also resolved relative to the openejb.home variable.
+
+h1. Embedded OpenEJB FAQ
+
+
+h2. What do you mean embedded?
+
+
+When your clients run OpenEJB in the same VM using the IntraVM Server, you're using OpenEJB as an embedded EJB Server just like InstantDB and Cloudscape are embedded databases servers. Just like InstantDB and Cloudscape, OpenEJB needs configuration files and other files to do it's job.
+
+OpenEJB is the only EJB server that I know of that you can run as an embedded library, so the fact that you can even do it is a real feather in our cap. If anyone knows of another, please tell me.
+
+In fact, anyone already using InstantDB or Cloudscape as embedded database servers in a product could just as easily use OpenEJB as an embedded EJB Server and add instant EJB support to the product as well. OpenEJB can easily play with InstantDB or Cloudscape, so it would be pretty slick. This would be extremely useful for IDEs like Visual Cafe, JBuilder, Visual Age, etc.
+
+h2. More info on openejb.conf files
+
+
+Here is an example of this. The openejb.home variable, which we will refer to as OPENEJB_HOME, is set to "c:\dir\openejb". The following relative path in your openejb.conf file will be resolved assuming OPENEJB_HOME as the base path.
+
+
+{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" />
+</openejb>
+{code}
+
+
+
+The above deployment path, "beans\", would automatically be expanded to "c:\dir\openejb\beans".
+
+If you want tell OpenEJB to look outside the OPENEJB_HOME, then use an absolute file path as shown below.
+
+
+{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" /></openejb>
+{code}
+
+
+
+OpenEJB can look in any number of directories for beans, just add those directories to your openejb.conf file as such.
+
+
+{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" />
+<Deployments dir="c:\my\app\my\beans\" /></openejb>
+{code}
+
+
+
+Furthermore, you can add jars individually to OpenEJB's deployment path by naming the jar directly.
+
+
+{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" />
+<Deployments dir="c:\my\app\my\beans\" />
+<Deployments dir="c:\my\special\beans\" />
+<Deployments dir="c:\foo\ejbs\" />
+<Deployments dir="d:\files\ejbjars\" /></openejb>
+{code}
+
+

Propchange: openejb/site/trunk/content/embedding-openejb.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/embedding-openejb.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/embedding-openejb.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/embedding-openejb.mdtext (added)
+++ openejb/site/trunk/content/embedding-openejb.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,335 @@
+Title: Embedding OpenEJB
+OpenEJB embedded in your app, server, IDE, or JUnit
+<a name="EmbeddingOpenEJB-Saywhat?!Alocalserver?"></a>
+# Say what?! A local server?
+
+
+Yes, you read correctly. OpenEJB can be embedded and treated as your very
+own personal EJB container.
+
+If they can have Local and Remote EJB's, why not Local and Remote EJB
+Servers too?
+
+Haven't you ever wanted EJBs without the heavy? I mean you need the "heavy"
+eventually, but not while you're developing. Well, there's the advantage of
+an EJB implementation that was designed with a very clean and well defined
+server-container contract, you can cut the server part out completely!
+
+So, if you wish to access ejbs locally and not in client/server mode, you
+can do so by embedding OpenEJB as a library and accessing ejbs through
+OpenEJB's built-in IntraVM (Local) Server. Why would someone want to do
+this?
+* Your application is a server or other middleware
+* You want to write an app that can be both stand alonedistributed
+* To test your EJBs with JUnit and don't want to start/stop servers and
+other nonsense
+* Imagine the power from being able to use your IDE debugger to step from
+your Client all the way into your EJB and back with no remote debugging
+voodoo.
+
+
+In this case, your application, test suite, IDE, or client accesses beans
+as you would from any other EJB Server. The EJB Server just happens to be
+running in the same virtual machine as your application. This EJB Server is
+thusly called the IntraVM Server, and, for all intense purposes, your
+application an IntraVM Client.
+
+There are some interesting differences though. The IntraVM Server isn't a
+heavyweight server as one normally associates with EJB. It doesn't open
+connections, launch threads for processing requests, introduce complex
+classloading heirarchies, or any of those "heavy" kind of things. All it
+does is dish out proxies to your app that can be used to shoot calls right
+into the EJB Container. Very light, very fast, very easy for testing,
+debugging, developing, etc.
+
+<a name="EmbeddingOpenEJB-AccessingEJBslocally"></a>
+# Accessing EJBs locally
+
+
+Try something like this for a simple IntraVM (Local) Client:
+
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+    import java.util.Properties;
+    import javax.naming.Context;
+    import javax.naming.InitialContext;
+    import javax.rmi.PortableRemoteObject;
+    import FooHome;
+    
+    public class MyEjbApplication {
+    
+    public static void main( String args[]
+) {
+      try{
+        
+        Properties properties = new Properties();
+        
+        properties.put(Context.INITIAL_CONTEXT_FACTORY, 
+    	"org.openejb.client.LocalInitialContextFactory");
+        
+        InitialContext ctx = new InitialContext(properties);
+        
+        Object obj = ctx.lookup("my/bean/Foo");
+        
+        FooHome ejbHome = (FooHome)
+    	PortableRemoteObject.narrow(obj, FooHome.class);
+      
+      } catch (Exception e){
+        e.printStackTRace();
+      }
+    }
+    }
+
+
+
+
+That would be the simplest spec compliant client you could create. If you
+don't care about spec compliance and just want to "cheat", you can do this:
+
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+    import javax.naming.InitialContext;
+    import FooHome;
+    
+    public class MyEjbApplication {
+    
+    public static void main( String args[]
+) {
+      try{
+        
+        FooHome ejbHome = (FooHome)new InitialContext().lookup(
+    			    "java:openejb/ejb/my/bean/Foo");
+      
+      } catch (Exception e){
+        e.printStackTRace();
+      }
+    }
+    }
+
+
+
+
+Now keep in mind, that is not spec compliant. Also keep in mind that we
+provide it as a convenience, so if there is something you don't like or
+think should be changed, send code.
+
+<a name="EmbeddingOpenEJB-Passinginitializationparameters"></a>
+# Passing initialization parameters
+
+
+When accessing OpenEJB in local (intra-vm) mode, the IntraVM server will
+instantiate OpenEJB for you. When it instantiates OpenEJB, it puts default
+values for the items in the Properties object OpenEJB needs to actually
+instantiate.
+
+If you want to pass OpenEJB specific parameters, you can do this in two
+ways:* Call init yourself before any JNDI calls are made
+* Pass the parameters in the InitialContext hashtable
+
+
+Refer to the [OpenEJB Specification](spec.html#openejb.api.html)
+ for information on the init method or the parameters you can pass to
+OpenEJB.
+
+Here is an example of passing the initialization parameters in to OpenEJB
+via the first InitialContext creation. I stress, this is only applicable
+the very first time and InitialContext is created within your Virtual
+Machine. After that, OpenEJB will have been initialized and the parameters
+will be ignored.
+
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+    import FooHome;
+    import java.util.Properties;
+    import javax.naming.Context;
+    import javax.naming.InitialContext;
+    import javax.rmi.PortableRemoteObject;
+    
+    public class MyEjbApplication {
+    
+    public static void main( String args[]
+) {
+      try{
+        
+        Properties p = new Properties();
+        
+        p.put(Context.INITIAL_CONTEXT_FACTORY, 
+    	  "org.openejb.client.LocalInitialContextFactory");
+        
+        p.put("openejb.home", "c:\\dir\\openejb");
+        
+        p.put("openejb.configuration", 
+    	  "c:\\my\\app\\conf\\openejb.conf");
+        
+        InitialContext ctx = new InitialContext( p );
+        
+        Object obj = ctx.lookup("my/bean/Foo");
+        
+        FooHome ejbHome = (FooHome)
+    	PortableRemoteObject.narrow(obj,FooHome.class);
+      
+      } catch (Exception e){
+        e.printStackTRace();
+      }
+    }
+    }
+
+
+
+
+<a name="EmbeddingOpenEJB-Settheopenejb.homevariable"></a>
+# Set the openejb.home variable
+
+
+If you use OpenEJB Local Server, you are actually using OpenEJB as an
+embedded library. This means when your application starts, OpenEJB will be
+starting too, in your virtual machine. Odds are you will not want to
+execute your application in the directory where OpenEJB was installed, but
+will want to execute your application where you are developing it. This is
+fine, but you will need to tell OpenEJB where it was installed. To do this,
+set the "openejb.home" system variable.
+
+For example, if OpenEJB was unpacked in the directory in c:\dir\openejb,
+you can set the openejb.home variable as a java vm flag as follows.
+
+*c:\my\app> java -Dopenejb.home=c:\dir\openejb MyEjbApplication*
+
+
+You can also set the openejb.home variable by calling
+System.setProperty(...) in your application before any calls to the OpenEJB
+Local Server are made.
+
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+    ...
+    public static void main(String args[]
+) {
+        
+      System.setProperty("openejb.home", "c:\\dir\\openejb");
+      ...
+      
+    }
+    ...
+
+
+
+
+As mentioned above, you can pass OpenEJB parameters on your first call to
+the Local Server.
+
+
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+    ...
+    public static void main( String args[]
+) {
+        
+      Properties p = new Properties();
+      
+      p.put(Context.INITIAL_CONTEXT_FACTORY, 
+    	"org.openejb.client.LocalInitialContextFactory");
+      
+      p.put("openejb.home", "c:\\dir\\openejb");
+          
+      InitialContext ctx = new InitialContext( p );
+      ...
+    }
+    ...
+
+
+
+
+When OpenEJB is started, it will look for its configuration files in the
+OPENJB_HOME/conf directory. The paths to beans in your openejb.conf file
+are also resolved relative to the openejb.home variable.
+
+<a name="EmbeddingOpenEJB-EmbeddedOpenEJBFAQ"></a>
+# Embedded OpenEJB FAQ
+
+
+<a name="EmbeddingOpenEJB-Whatdoyoumeanembedded?"></a>
+## What do you mean embedded?
+
+
+When your clients run OpenEJB in the same VM using the IntraVM Server,
+you're using OpenEJB as an embedded EJB Server just like InstantDB and
+Cloudscape are embedded databases servers. Just like InstantDB and
+Cloudscape, OpenEJB needs configuration files and other files to do it's
+job.
+
+OpenEJB is the only EJB server that I know of that you can run as an
+embedded library, so the fact that you can even do it is a real feather in
+our cap. If anyone knows of another, please tell me.
+
+In fact, anyone already using InstantDB or Cloudscape as embedded database
+servers in a product could just as easily use OpenEJB as an embedded EJB
+Server and add instant EJB support to the product as well. OpenEJB can
+easily play with InstantDB or Cloudscape, so it would be pretty slick. This
+would be extremely useful for IDEs like Visual Cafe, JBuilder, Visual Age,
+etc.
+
+<a name="EmbeddingOpenEJB-Moreinfoonopenejb.conffiles"></a>
+## More info on openejb.conf files
+
+
+Here is an example of this. The openejb.home variable, which we will refer
+to as OPENEJB_HOME, is set to "c:\dir\openejb". The following relative path
+in your openejb.conf file will be resolved assuming OPENEJB_HOME as the
+base path.
+
+
+{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" />
+</openejb>
+
+    
+    
+    
+    The above deployment path, "beans\", would automatically be expanded to
+"c:\dir\openejb\beans".
+    
+    If you want tell OpenEJB to look outside the OPENEJB_HOME, then use an
+absolute file path as shown below.
+    
+    
+    {code:xml|title=openejb.conf}
+    <openejb>
+    ...
+    
+    <Deployments dir="beans\" /></openejb>
+
+
+
+
+OpenEJB can look in any number of directories for beans, just add those
+directories to your openejb.conf file as such.
+
+
+{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" />
+<Deployments dir="c:\my\app\my\beans\" /></openejb>
+
+    
+    
+    
+    Furthermore, you can add jars individually to OpenEJB's deployment path by
+naming the jar directly.
+    
+    
+    {code:xml|title=openejb.conf}
+    <openejb>
+    ...
+    
+    <Deployments dir="beans\" />
+    <Deployments dir="c:\my\app\my\beans\" />
+    <Deployments dir="c:\my\special\beans\" />
+    <Deployments dir="c:\foo\ejbs\" />
+    <Deployments dir="d:\files\ejbjars\" /></openejb>
+
+
+

Added: openejb/site/trunk/content/embedding.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/embedding.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/embedding.cwiki (added)
+++ openejb/site/trunk/content/embedding.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+{include:OPENEJBx30:Embedding}
\ No newline at end of file

Propchange: openejb/site/trunk/content/embedding.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/embedding.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/embedding.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/embedding.mdtext (added)
+++ openejb/site/trunk/content/embedding.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,2 @@
+Title: Embedding
+{include:OPENEJBx30:Embedding}

Added: openejb/site/trunk/content/example-generated-documentation.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/example-generated-documentation.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/example-generated-documentation.cwiki (added)
+++ openejb/site/trunk/content/example-generated-documentation.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1,130 @@
+{anchor: containers}
+h2. Containers
+{anchor:Default CMP Container-container}
+h3. Default CMP Container
+    || Property Name || Description ||
+    | CmpEngineFactory | Default value is _org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory_.||
+
+{anchor:Default BMP Container-container}
+h3. Default BMP Container
+    || Property Name || Description ||
+    | PoolSize | Specifies the size of the bean pools for this\\ bmp entity container.\\ \\ Default value is _10_.||
+
+{anchor:Default Stateless Container-container}
+h3. Default Stateless Container
+    || Property Name || Description ||
+    | TimeOut | Specifies the time to wait between invocations. This\\ value is measured in milliseconds. A value of 5 would\\ result in a time\-out of 5 milliseconds between invocations.\\ A value of zero would mean no timeout.\\ \\ Default value is _0_.||
+    | PoolSize | Specifies the size of the bean pools for this\\ stateless SessionBean container.\\ \\ Default value is _10_.||
+    | StrictPooling | StrictPooling tells the container what to do when the pool\\ reaches it's maximum size and there are incoming requests\\ that need instances.\\ \\ With strict pooling, requests will have to wait for instances\\ to become available. The pool size will never grow beyond the\\ the set PoolSize value.\\ \\ Without strict pooling, the container will create temporary\\ instances to meet demand. The instances will last for just one\\ method invocation and then are removed.\\ \\ Default value is _true_.||
+
+{anchor:Default Stateful Container-container}
+h3. Default Stateful Container
+    || Property Name || Description ||
+    | Passivator | The passivator is responsible for writing beans to disk\\ at passivation time. Different passivators can be used\\ by setting this property to the fully qualified class name\\ of the PassivationStrategy implementation. The passivator\\ is not responsible for invoking any callbacks or other\\ processing, its only responsibly is to write the bean state\\ to disk.\\ \\ Known implementations:\\ org.apache.openejb.core.stateful.RAFPassivater\\ org.apache.openejb.core.stateful.SimplePassivater\\ \\ Default value is _org.apache.openejb.core.stateful.SimplePassivater_.||
+    | TimeOut | Specifies the time to wait between invocations. This\\ value is measured in minutes. A value of 5 would\\ result in a time\-out of 5 minutes between invocations.\\ A value of zero would mean no timeout.\\ \\ Default value is _20_.||
+    | PoolSize | Specifies the size of the bean pools for this\\ stateful SessionBean container.\\ \\ Default value is _1000_.||
+    | BulkPassivate | Property name that specifies the number of instances\\ to passivate at one time when doing bulk passivation.\\ \\ Default value is _100_.||
+
+{anchor:Default MDB Container-container}
+h3. Default MDB Container
+    || Property Name || Description ||
+    | ResourceAdapter | The resource adapter delivers messages to the container\\ \\ Default value is _Default JMS Resource Adapter_.||
+    | MessageListenerInterface | Specifies the message listener interface handled by this container\\ \\ Default value is _javax.jms.MessageListener_.||
+    | ActivationSpecClass | Specifies the activation spec class\\ \\ Default value is _org.apache.activemq.ra.ActiveMQActivationSpec_.||
+    | InstanceLimit | Specifies the maximum number of bean instances that are\\ allowed to exist for each MDB deployment.\\ \\ Default value is _10_.||
+
+
+{anchor: resources}
+h2. Resources
+{anchor:Default JDBC Database-resource}
+h3. Default JDBC Database
+    || Property Name || Description ||
+    | JtaManaged | Determines wether or not this data source should be JTA managed\\ or user managed.{html}&nbsp;&nbsp;{html}If set to 'true' it will automatically be enrolled\\ in any ongoing transactions.{html}&nbsp;&nbsp;{html}Calling begin/commit/rollback or setAutoCommit\\ on the datasource or connection will not be allowed.{html}&nbsp;&nbsp;{html}If you need to perform\\ these functions yourself, set JtaManaged to 'false'\\ \\ In terms of JPA persistence.xml:\\ "JtaManaged=true" can be used as a 'jta\-data\-source'\\ "JtaManaged=false" can be used as a 'non\-jta\-data\-source'\\ \\ Default value is _true_.||
+    | JdbcDriver | Driver class name\\ \\ Default value is _org.hsqldb.jdbcDriver_.||
+    | JdbcUrl | Url for creating connections\\ \\ Default value is _jdbc:hsqldb:{html}file:{html}data/hsqldb/hsqldb_.||
+    | UserName | Default user name\\ \\ Default value is _sa_.||
+    | Password | Default password|
+    | ConnectionProperties | The connection properties that will be sent to the JDBC\\ driver when establishing new connections\\ \\ Format of the string must be \[propertyName=property;\]\*\\ \\ NOTE \- The "user" and "password" properties will be passed\\ explicitly, so they do not need to be included here.|
+    | DefaultAutoCommit | The default auto\-commit state of new connections\\ \\ Default value is _true_.||
+    | DefaultReadOnly | The default read\-only state of new connections\\ If not set then the setReadOnly method will not be called.\\ \(Some drivers don't support read only mode, ex: Informix\)|
+    | DefaultTransactionIsolation | The default TransactionIsolation state of new connections\\ If not set then the setTransactionIsolation method will not\\ be called. The allowed values for this property are:\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} NONE\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} READ\_COMMITTED\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} READ\_UNCOMMITTED\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} REPEATABLE\_READ\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} SERIALIZABLE\\ \\ Note: Most JDBC drivers do not support all isolation levels|
+    | InitialSize | The initial number of connections that are created when the\\ pool is started\\ \\ Default value is _0_.||
+    | MaxActive | The maximum number of active connections that can be\\ allocated from this pool at the same time, or a negative\\ number for no limit.\\ \\ Default value is _20_.||
+    | MaxIdle | The maximum number of connections that can remain idle in\\ the pool, without extra ones being released, or a negative\\ number for no limit.\\ \\ Default value is _20_.||
+    | MinIdle | The minimum number of connections that can remain idle in\\ the pool, without extra ones being created, or zero to\\ create none.\\ \\ Default value is _0_.||
+    | MaxWait | The maximum number of milliseconds that the pool will wait\\ \(when there are no available connections\) for a connection\\ to be returned before throwing an exception, or \-1 to wait\\ indefinitely.\\ \\ Default value is _\-1_.||
+    | ValidationQuery | The SQL query that will be used to validate connections from\\ this pool before returning them to the caller. If specified,\\ this query MUST be an SQL SELECT statement that returns at\\ least one row.|
+    | TestOnBorrow | If true connections will be validated before being returned\\ from the pool. If the validation fails, the connection is\\ destroyed, and a new conection will be retrieved from the\\ pool \(and validated\).\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _true_.||
+    | TestOnReturn | If true connections will be validated before being returned\\ to the pool.{html}&nbsp;&nbsp;{html}If the validation fails, the connection is\\ destroyed instead of being returned to the pool.\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+    | TestWhileIdle | If true connections will be validated by the idle connection\\ evictor \(if any\). If the validation fails, the connection is\\ destroyed and removed from the pool\\ \\ NOTE \- for a true value to have any effect, the\\ timeBetweenEvictionRunsMillis property must be a positive\\ number and the ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+    | TimeBetweenEvictionRunsMillis | The number of milliseconds to sleep between runs of the idle\\ connection evictor thread. When set to a negative number, no\\ idle connection evictor thread will be run.\\ \\ Default value is _\-1_.||
+    | NumTestsPerEvictionRun | The number of connectionss to examine during each run of the\\ idle connection evictor thread \(if any\).\\ \\ Default value is _3_.||
+    | MinEvictableIdleTimeMillis | The minimum amount of time a connection may sit idle in the\\ pool before it is eligable for eviction by the idle\\ connection evictor \(if any\).\\ \\ Default value is _1800000_.||
+    | PoolPreparedStatements | If true, a statement pool is created for each Connection and\\ PreparedStatements created by one of the following methods are\\ pooled:\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}public PreparedStatement prepareStatement\(String sql\);\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}public PreparedStatement prepareStatement\(String sql,\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}int resultSetType,\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}int resultSetConcurrency\)\\ \\ Default value is _false_.||
+    | MaxOpenPreparedStatements | The maximum number of open statements that can be allocated\\ from the statement pool at the same time, or zero for no\\ limit.\\ \\ NOTE \- Some drivers have limits on the number of open\\ statements, so make sure there are some resources left\\ for the other \(non\-prepared\) statements.\\ \\ Default value is _0_.||
+    | AccessToUnderlyingConnectionAllowed | If true the raw physical connection to the database can be\\ accessed using the following construct:\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} Connection conn = ds.getConnection\(\);\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} Connection rawConn = \(\(DelegatingConnection\) conn\).getInnermostDelegate\(\);\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} ...\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} conn.close\(\)\\ \\ Default is false, because misbehaving programs can do harmfull\\ things to the raw connection shuch as closing the raw\\ connection or continuing to use the raw connection after it\\ has been assigned to another logical connection.{html}&nbsp;&nbsp;{html}Be carefull\\ and only use when you need direct access to driver specific\\ extentions.\\ \\ NOTE: Do NOT close the underlying connection, only the\\ original logical connection wrapper.\\ \\ Default value is _false_.||
+
+{anchor:Default Unmanaged JDBC Database-resource}
+h3. Default Unmanaged JDBC Database
+    || Property Name || Description ||
+    | JtaManaged | Default value is _false_.||
+    | JdbcDriver | Driver class name\\ \\ Default value is _org.hsqldb.jdbcDriver_.||
+    | JdbcUrl | Url for creating connections\\ \\ Default value is _jdbc:hsqldb:{html}file:{html}data/hsqldb/hsqldb_.||
+    | UserName | Default user name\\ \\ Default value is _sa_.||
+    | Password | Default password|
+    | ConnectionProperties | The connection properties that will be sent to the JDBC\\ driver when establishing new connections\\ \\ Format of the string must be \[propertyName=property;\]\*\\ \\ NOTE \- The "user" and "password" properties will be passed\\ explicitly, so they do not need to be included here.|
+    | DefaultAutoCommit | The default auto\-commit state of new connections\\ \\ Default value is _true_.||
+    | DefaultReadOnly | The default read\-only state of new connections\\ If not set then the setReadOnly method will not be called.\\ \(Some drivers don't support read only mode, ex: Informix\)|
+    | DefaultTransactionIsolation | The default TransactionIsolation state of new connections\\ If not set then the setTransactionIsolation method will not\\ be called. The allowed values for this property are:\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} NONE\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} READ\_COMMITTED\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} READ\_UNCOMMITTED\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} REPEATABLE\_READ\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} SERIALIZABLE\\ \\ Note: Most JDBC drivers do not support all isolation levels|
+    | InitialSize | The initial number of connections that are created when the\\ pool is started\\ \\ Default value is _0_.||
+    | MaxActive | The maximum number of active connections that can be\\ allocated from this pool at the same time, or a negative\\ number for no limit.\\ \\ Default value is _10_.||
+    | MaxIdle | The maximum number of connections that can remain idle in\\ the pool, without extra ones being released, or a negative\\ number for no limit.\\ \\ Default value is _10_.||
+    | MinIdle | The minimum number of connections that can remain idle in\\ the pool, without extra ones being created, or zero to\\ create none.\\ \\ Default value is _0_.||
+    | MaxWait | The maximum number of milliseconds that the pool will wait\\ \(when there are no available connections\) for a connection\\ to be returned before throwing an exception, or \-1 to wait\\ indefinitely.\\ \\ Default value is _\-1_.||
+    | ValidationQuery | The SQL query that will be used to validate connections from\\ this pool before returning them to the caller. If specified,\\ this query MUST be an SQL SELECT statement that returns at\\ least one row.|
+    | TestOnBorrow | If true connections will be validated before being returned\\ from the pool. If the validation fails, the connection is\\ destroyed, and a new conection will be retrieved from the\\ pool \(and validated\).\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _true_.||
+    | TestOnReturn | If true connections will be validated before being returned\\ to the pool.{html}&nbsp;&nbsp;{html}If the validation fails, the connection is\\ destroyed instead of being returned to the pool.\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+    | TestWhileIdle | If true connections will be validated by the idle connection\\ evictor \(if any\). If the validation fails, the connection is\\ destroyed and removed from the pool\\ \\ NOTE \- for a true value to have any effect, the\\ timeBetweenEvictionRunsMillis property must be a positive\\ number and the ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+    | TimeBetweenEvictionRunsMillis | The number of milliseconds to sleep between runs of the idle\\ connection evictor thread. When set to a negative number, no\\ idle connection evictor thread will be run.\\ \\ Default value is _\-1_.||
+    | NumTestsPerEvictionRun | The number of connectionss to examine during each run of the\\ idle connection evictor thread \(if any\).\\ \\ Default value is _3_.||
+    | MinEvictableIdleTimeMillis | The minimum amount of time a connection may sit idle in the\\ pool before it is eligable for eviction by the idle\\ connection evictor \(if any\).\\ \\ Default value is _1800000_.||
+    | PoolPreparedStatements | If true, a statement pool is created for each Connection and\\ PreparedStatements created by one of the following methods are\\ pooled:\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}public PreparedStatement prepareStatement\(String sql\);\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}public PreparedStatement prepareStatement\(String sql,\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}int resultSetType,\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}{html}&nbsp;&nbsp;&nbsp;&nbsp;{html}int resultSetConcurrency\)\\ \\ Default value is _false_.||
+    | MaxOpenPreparedStatements | The maximum number of open statements that can be allocated\\ from the statement pool at the same time, or zero for no\\ limit.\\ \\ NOTE \- Some drivers have limits on the number of open\\ statements, so make sure there are some resources left\\ for the other \(non\-prepared\) statements.\\ \\ Default value is _0_.||
+    | AccessToUnderlyingConnectionAllowed | If true the raw physical connection to the database can be\\ accessed using the following construct:\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} Connection conn = ds.getConnection\(\);\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} Connection rawConn = \(\(DelegatingConnection\) conn\).getInnermostDelegate\(\);\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} ...\\{html}&nbsp;&nbsp;&nbsp;&nbsp;{html} conn.close\(\)\\ \\ Default is false, because misbehaving programs can do harmfull\\ things to the raw connection shuch as closing the raw\\ connection or continuing to use the raw connection after it\\ has been assigned to another logical connection.{html}&nbsp;&nbsp;{html}Be carefull\\ and only use when you need direct access to driver specific\\ extentions.\\ \\ NOTE: Do NOT close the underlying connection, only the\\ original logical connection wrapper.\\ \\ Default value is _false_.||
+
+{anchor:Default JMS Resource Adapter-resource}
+h3. Default JMS Resource Adapter
+    || Property Name || Description ||
+    | BrokerXmlConfig | Broker configuration\\ \\ Default value is _broker:\(tcp://localhost:61616\)\?useJmx=false_.||
+    | ServerUrl | Broker address\\ \\ Default value is _vm://localhost\?async=true_.||
+    | DataSource | DataSource for persistence messages\\ \\ Default value is _Default Unmanaged JDBC Database_.||
+    | ThreadPoolSize | Specifies the size of the thread pool available to AciveMQ.\\ \\ Default value is _30_.||
+
+{anchor:Default JMS Connection Factory-resource}
+h3. Default JMS Connection Factory
+    || Property Name || Description ||
+    | ResourceAdapter | Default value is _Default JMS Resource Adapter_.||
+    | TransactionSupport | Specifies if the connection is enrolled in global transaction\\ allowed values: xa, local or none\\ \\ Default value is _xa_.||
+    | PoolMaxSize | Maximum number of physical connection to the ActiveMQ broker\\ \\ Default value is _10_.||
+    | PoolMinSize | Minimum number of physical connection to the ActiveMQ broker\\ \\ Default value is _0_.||
+    | ConnectionMaxWaitMilliseconds | Maximum amount of time to wait for a connection\\ \\ Default value is _5000_.||
+    | ConnectionMaxIdleMinutes | Maximum amount of time a connection can be idle before being reclaimed\\ \\ Default value is _15_.||
+
+{anchor:Default Queue-resource}
+h3. Default Queue
+    || Property Name || Description ||
+    | destination | Specifies the name of the queue|
+
+{anchor:Default Topic-resource}
+h3. Default Topic
+    || Property Name || Description ||
+    | destination | Specifies the name of the topic|
+
+{anchor:Default ORB-resource}
+h3. Default ORB
+No properties.
+
+{anchor:Default Mail Session-resource}
+h3. Default Mail Session
+No properties.
+

Propchange: openejb/site/trunk/content/example-generated-documentation.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/example-generated-documentation.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/example-generated-documentation.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/example-generated-documentation.mdtext (added)
+++ openejb/site/trunk/content/example-generated-documentation.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,213 @@
+Title: Example Generated Documentation
+{anchor: containers}
+<a name="ExampleGeneratedDocumentation-Containers"></a>
+## Containers
+{anchor:Default CMP Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultCMPContainer"></a>
+### Default CMP Container
+    || Property Name || Description ||
+    | CmpEngineFactory | Default value is
+_org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory_.||
+
+{anchor:Default BMP Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultBMPContainer"></a>
+### Default BMP Container
+    || Property Name || Description ||
+  
+  
+
+{anchor:Default Stateless Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultStatelessContainer"></a>
+### Default Stateless Container
+    || Property Name || Description ||
+  
+  
+  
+  
+  
+  
+
+{anchor:Default Stateful Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultStatefulContainer"></a>
+### Default Stateful Container
+    || Property Name || Description ||
+  
+  
+  
+  
+  
+  
+  
+  
+
+{anchor:Default MDB Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultMDBContainer"></a>
+### Default MDB Container
+    || Property Name || Description ||
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+{anchor: resources}
+<a name="ExampleGeneratedDocumentation-Resources"></a>
+## Resources
+{anchor:Default JDBC Database-resource}
+<a name="ExampleGeneratedDocumentation-DefaultJDBCDatabase"></a>
+### Default JDBC Database
+    || Property Name || Description ||
+  
+  
+  
+  
+  
+  
+  
+  
+    | Password | Default password|
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+{anchor:Default Unmanaged JDBC Database-resource}
+<a name="ExampleGeneratedDocumentation-DefaultUnmanagedJDBCDatabase"></a>
+### Default Unmanaged JDBC Database
+    || Property Name || Description ||
+    | JtaManaged | Default value is _false_.||
+  
+  
+  
+  
+  
+  
+    | Password | Default password|
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+{anchor:Default JMS Resource Adapter-resource}
+<a name="ExampleGeneratedDocumentation-DefaultJMSResourceAdapter"></a>
+### Default JMS Resource Adapter
+    || Property Name || Description ||
+  
+  
+  
+  
+  
+  
+  
+  
+
+{anchor:Default JMS Connection Factory-resource}
+<a name="ExampleGeneratedDocumentation-DefaultJMSConnectionFactory"></a>
+### Default JMS Connection Factory
+    || Property Name || Description ||
+    | ResourceAdapter | Default value is _Default JMS Resource Adapter_.||
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+{anchor:Default Queue-resource}
+<a name="ExampleGeneratedDocumentation-DefaultQueue"></a>
+### Default Queue
+    || Property Name || Description ||
+    | destination | Specifies the name of the queue|
+
+{anchor:Default Topic-resource}
+<a name="ExampleGeneratedDocumentation-DefaultTopic"></a>
+### Default Topic
+    || Property Name || Description ||
+    | destination | Specifies the name of the topic|
+
+{anchor:Default ORB-resource}
+<a name="ExampleGeneratedDocumentation-DefaultORB"></a>
+### Default ORB
+No properties.
+
+{anchor:Default Mail Session-resource}
+<a name="ExampleGeneratedDocumentation-DefaultMailSession"></a>
+### Default Mail Session
+No properties.
+

Added: openejb/site/trunk/content/examples.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/examples.cwiki?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/examples.cwiki (added)
+++ openejb/site/trunk/content/examples.cwiki Sun Jul 10 04:33:54 2011
@@ -0,0 +1 @@
+{include:OPENEJBx30:Examples}
\ No newline at end of file

Propchange: openejb/site/trunk/content/examples.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/examples.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/examples.mdtext?rev=1144777&view=auto
==============================================================================
--- openejb/site/trunk/content/examples.mdtext (added)
+++ openejb/site/trunk/content/examples.mdtext Sun Jul 10 04:33:54 2011
@@ -0,0 +1,2 @@
+Title: Examples
+{include:OPENEJBx30:Examples}