| Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.5.0) Part Number E13981-01 |
|
|
View PDF |
You can configure OC4J-proprietary deployment options for an EJB 3.0 session bean using OC4J-proprietary annotations (see "Using Annotations") or using the orion-ejb-jar.xml file (see "Using Deployment XML").
Configuration in the orion-ejb-jar.xml file overrides the corresponding configuration made using OC4J-proprietary annotations.
You can specify OC4J-proprietary deployment options for an EJB 3.0 session bean using the following OC4J-proprietary annotations:
Example 5-10 shows how to configure OC4J-proprietary deployment options for an EJB 3.0 stateless session bean using the @StatelessDeployment annotation.
For more information on @StatelessDeployment attributes, see Table A-1.
Example 5-10 @StatelessDeployment
import javax.ejb.Stateless;
import oracle.j2ee.ejb.StatelessDeployment;
@Stateless
@StatelessDeployment(
minInstances=5,
poolCacheTimeout=90
)
public class HelloWorldBean implements HelloWorld {
public void sayHello(String name) {
System.out.println("Hello "+name +" from first EJB3.0");
}
}
Example 5-11 shows how to configure OC4J-proprietary deployment options for an EJB 3.0 stateful session bean using the @StatefulDeployment annotation.
For more information on @StatefulDeployment attributes, see Table A-1.
You can specify OC4J-proprietary deployment options using the orion-ejb-jar.xml file element <session-deployment> as Example 5-12 shows.
For more information on the <session-deployment> element, see "<session-deployment>".
Example 5-12 orion-ejb-jar.xml File <session-deployment> Element
<?xml version="1.0" encoding="utf-8"?>
<orion-ejb-jar
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-ejb-jar-10_0.xsd"
deployment-version="10.1.3.1.0"
deployment-time="10b1fb5cdd0"
schema-major-version="10"
schema-minor-version="0"
>
<enterprise-beans>
<session-deployment
name="MBeanServerEjb"
call-timeout="0"
location="MBeanServerEjb"
local-location="admin_ejb_MBeanServerEjbLocal"
timeout="0"
...
>
</session-deployment>
...
</enterprise-beans>
...
</orion-ejb-jar>