...
Module Type | Geronimo Schema | Description |
---|---|---|
Server Plans & Common Elements | Used to deploy new services in Geronimo in a standalone plan, and also contains common elements used by many other plans. | |
Geronimo Plugin Descriptor | Metadata on a Geronimo plugin or a list of available Geronimo plugins. | |
Security Mapping | Common security elements used by other plans. | |
Security Realms | Abbreviated syntax for configuring security realm and login module GBeans. You can either manually configure multiple GBeans or declare a single GBean for the realm using this to configure all the login modules. | |
Naming | Common elements for references to other components (EJBs, database pools, JMS resources, J2EE Connectors, Web Services, etc.) | |
Primary Key Generator | Abbreviated syntax for configuring primary key generators for CMP entity beans. Avoids manually configuring and wiring up PK generator GBeans. | |
CORBA CSS Configuration | Abbreviated syntax for configuring security for clients accessing remote EJBs via CORBA. | |
CORBA TSS Configuration | Abbreviated syntax for configuring security for EJBs exposed via CORBA. | |
config.xml | The format of the | |
Tomcat Web App Configuration | If you use the generic ( | |
Jetty Web App Configuration | If you use the generic ( |
Configurations
The examples provided in In this section are independent of any application. Most of these configurations can be generated and deployed through the Geronimo Administration Console as well.
Connection pools
For the most part, deployment plans for database connection pool will be very similar from each other. However, depending on the database the pool will be connecting to, you may need to specify some additional parameters.
Embedded Derdy DB
, we will discuss about the configurations that are already deployed and running in the server when the server is installed and started.
Connection pools
Apache geronimo ships with embedded derby database and activemq message broker. There are also connection pools that connect to derby and activemq configured to run in the installed server. The following sections discuss about various such configurations already available in the installed server.
Embedded Derby Database connection pool
Apache Geronimo ships with embedded derby database. The derby libraries are present in the server repository at <geronimo_home>/repository/org/apache/derby
. By default, a derby database by name SystemDatabase
is created and the database related files are stored at <geronimo_home>/var/derby/SystemDatabase
. Along with that, by default, server deploys a database connection pool over the SystemDatabase
with the configuration name org.apache.geronimo.configs/system-database/2.1/car
. The name of the database connection pool is SystemDatasource
. The configuration artifacts are stored at <geronimo_home>/repository/org/apache/geronimo/configs/system-database
. The deployment plan used for database connection pool is as follows.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
<dep:moduleId>
<dep:groupId>org.apache.geronimo.configs</dep:groupId>
<dep:artifactId>system-database</dep:artifactId>
<dep:version>2.1</dep:version>
<dep:type>car</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>org.apache.geronimo.configs</dep:groupId>
<dep:artifactId>transaction</dep:artifactId>
<dep:version>2.1</dep:version>
<dep:type>car</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.geronimo.modules</dep:groupId>
<dep:artifactId>geronimo-derby</dep:artifactId>
<dep:version>2.1</dep:version>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.geronimo.modules</dep:groupId>
<dep:artifactId>geronimo-timer</dep:artifactId>
<dep:version>2.1</dep:version>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.derby</dep:groupId>
<dep:artifactId>derby</dep:artifactId>
<dep:version>10.2.2.0</dep:version>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.derby</dep:groupId>
<dep:artifactId>derbynet</dep:artifactId>
<dep:version>10.2.2.0</dep:version>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.apache.derby</dep:groupId>
<dep:artifactId>derbyclient</dep:artifactId>
<dep:version>10.2.2.0</dep:version>
<dep:type>jar</dep:type>
</dep:dependency>
<dep:dependency>
<dep:groupId>org.tranql</dep:groupId>
<dep:artifactId>tranql-connector-derby-embed-xa</dep:artifactId>
<dep:version>1.3</dep:version>
<dep:type>rar</dep:type>
</dep:dependency>
</dep:dependencies>
<dep:hidden-classes/>
<dep:non-overridable-classes/>
</dep:environment>
<resourceadapter>
<outbound-resourceadapter>
<connection-definition>
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
<connectiondefinition-instance>
<name>SystemDatasource</name>
<config-property-setting name="UserName"/>
<config-property-setting name="Password"/>
<config-property-setting name="DatabaseName">SystemDatabase</config-property-setting>
<config-property-setting name="CreateDatabase">true</config-property-setting>
<connectionmanager>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
<single-pool>
<max-size>100</max-size>
<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
<select-one-assume-match/>
</single-pool>
</connectionmanager>
</connectiondefinition-instance>
<connectiondefinition-instance>
<name>NoTxDatasource</name>
<config-property-setting name="UserName"/>
<config-property-setting name="Password"/>
<config-property-setting name="DatabaseName">SystemDatabase</config-property-setting>
<config-property-setting name="CreateDatabase">true</config-property-setting>
<connectionmanager>
<no-transaction/>
<single-pool>
<max-size>100</max-size>
<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
<select-one-assume-match/>
</single-pool>
</connectionmanager>
</connectiondefinition-instance>
</connection-definition>
</outbound-resourceadapter>
</resourceadapter>
<gbean name="DerbySystem" class="org.apache.geronimo.derby.DerbySystemGBean">
<reference name="ServerInfo">
<name>ServerInfo</name>
</reference>
<attribute name="derbySystemHome">var/derby</attribute>
</gbean>
<gbean name="DerbyNetwork" class="org.apache.geronimo.derby.DerbyNetworkGBean">
<reference name="derbySystem">
<name>DerbySystem</name>
</reference>
<attribute name="host">localhost</attribute>
<attribute name="port">1527</attribute>
</gbean>
<gbean name="DerbyLog" class="org.apache.geronimo.derby.DerbyLogGBean">
<reference name="DerbySystem">
<name>DerbySystem</name>
</reference>
</gbean>
<gbean name="DerbyDriver" class="org.apache.geronimo.system.util.JDBCDriverRegistrationGBean">
<attribute name="driverClassName">org.apache.derby.jdbc.EmbeddedDriver</attribute>
</gbean>
<gbean name="DerbyClientDriver" class="org.apache.geronimo.system.util.JDBCDriverRegistrationGBean">
<attribute name="driverClassName">org.apache.derby.jdbc.ClientDriver</attribute>
</gbean>
<gbean name="TransactionalThreadPooledTimer" class="org.apache.geronimo.timer.jdbc.JDBCStoreThreadPooledTransactionalTimer">
<attribute name="repeatCount">5</attribute>
<reference name="TransactionManager">
<name>TransactionManager</name>
</reference>
<reference name="ManagedConnectionFactoryWrapper">
<name>SystemDatasource</name>
</reference>
<reference name="ThreadPool">
<name>DefaultThreadPool</name>
</reference>
<dependency>
<name>DerbySystem</name>
</dependency>
</gbean>
<gbean name="NonTransactionalThreadPooledTimer" class="org.apache.geronimo.timer.jdbc.JDBCStoreThreadPooledNonTransactionalTimer">
<reference name="TransactionManager">
<name>TransactionManager</name>
</reference>
<reference name="ManagedConnectionFactoryWrapper">
<name>SystemDatasource</name>
</reference>
<reference name="ThreadPool">
<name>DefaultThreadPool</name>
</reference>
<dependency>
<name>DerbySystem</name>
</dependency>
</gbean>
</connector>
|
Code Block | |
---|---|
{note}The default namespace of the above XML document is {{http://geronimo.apache.org/xml/ns/j2ee/connector-1.2}}. The XML elements that do not have a namespace prefix belong to the default namespace.{note}
After starting the server, the running database connection pool {{SystemDatasource}} can be observed from the geronimo admin console from {{console Navigation => Services => Database pools}}. The resource adapter used to deploy the above database connection pool is {{tranql-connector-derby-embed-xa-1.3.rar}}. The above plan is actually deployment plan of a outbound resource adapter. When the above plan is packaged along with the {{rar}} file, the xml content will be placed in {{META-INF/geronimo-ra.xml}} file.
Closely observe various configurations in the deployment plan. Many derby libraries in the server repository are mentioned as dependencies. After configuring the outbound resource adapter, there are series of gbeans configured for the database connection pool.
h3. Embedded ActiveMQ resource adapter
By default, a JMS resource adapter that connects to embedded activemq message broker is deployed and running in the apache geronimo server. This is an outbound jms resource adapter that configures a connection factory and two message queues. The configuration name of the resource adapter is {{org.apache.geronimo.configs/activemq-ra/2.1/car}}. The artifacts of the resource adapter are stored at {{<geronimo_home>/repository/org/apache/geronimo/configs/activemq-ra}}. The deployment plan is as follows.
{code:XML|borderStyle=solid|title=ActiveMQ RA} | |
Code Block | |
xml | xml |
borderStyle | solid |
title | Embedded Derdy DB connection pool deployment plan | <?xml version="1.0" encoding="UTF-8"?> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"> <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"> <dep:moduleId> <dep:groupId>console.dbpool<:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>TimeReportPool<artifactId>activemq-ra</dep:artifactId> <dep:version>1version>2.0<1</dep:version> <dep:type>rar<type>car</dep:type> </dep:moduleId> <dep:dependencies> <dep:dependency> <dep:groupId>org.apache.geronimo.configs</dep:groupId> <dep:artifactId>activemq-broker</dep:artifactId> <dep:artifactId>system-database<version>2.1</dep:artifactId>version> <<dep:type>car</dep:dependency>type> </dep:dependencies>dependency> </dep:environment>dependencies> <resourceadapter><dep:hidden-classes/> <outbound-resourceadapter><dep:non-overridable-classes/> </dep:environment> <resourceadapter> <connection-definition> <resourceadapter-instance> <resourceadapter-name>ActiveMQ RA</resourceadapter-name> <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface><config-property-setting name="ServerUrl">tcp://0.0.0.0:61616</config-property-setting> <config-property-setting name="UserName">geronimo</config-property-setting> <connectiondefinition-instance><config-property-setting name="Password">geronimo</config-property-setting> <workmanager> <gbean-link>DefaultWorkManager</gbean-link> <name>TimeReportPool<</name>workmanager> </resourceadapter-instance> <outbound-resourceadapter> <connection-definition> <config-property-setting name="Driver">org.apache.derby.jdbc.EmbeddedDriver</config-property-setting><connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface> <connectiondefinition-instance> <name>DefaultActiveMQConnectionFactory</name> <config-property-setting name="ConnectionURL">jdbc:derby:TimeReportDB</config-property-setting><implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface> <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface> <connectionmanager> <xa-transaction> <local<transaction-transactioncaching/> </xa-transaction> <single-pool> <max-size>10</max-size> <max<blocking-timeout-size>10<milliseconds>5000</maxblocking-timeout-size>milliseconds> <match-one/> <min-size>0</min-size></single-pool> </connectionmanager> </connectiondefinition-instance> </connection-definition> <match-one/></outbound-resourceadapter> </resourceadapter> <adminobject> <adminobject-interface>javax.jms.Queue</adminobject-interface> <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class> <adminobject-instance> </single-pool><message-destination-name>MDBTransferBeanOutQueue</message-destination-name> <config-property-setting name="PhysicalName">MDBTransferBeanOutQueue</config-property-setting> </adminobject-instance> </adminobject> <adminobject> </connectionmanager><adminobject-interface>javax.jms.Queue</adminobject-interface> <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class> <adminobject-instance> </connectiondefinition-instance><message-destination-name>SendReceiveQueue</message-destination-name> </connection-definition> <config-property-setting name="PhysicalName">SendReceiveQueue</config-property-setting> </outboundadminobject-resourceadapter>instance> </resourceadapter>adminobject> </connector> |
Note |
---|
The default namespace of the above XML document is deployment plan is {{ http://geronimo.apache.org/xml/ns/j2ee/connector-1.2 |
The resource adapter used to deploy the above plan is <geronimo_home>/repository/org/apache/geronimo/modules/geronimo-activemq-ra/2.1
. After the server is started, the running resource adapter can be look up from the admin console from Console Navigation => Services => JMS Resource
. We can also observe the connection factories and queues deployed by the resource adapter.
Security
A Java EE application may consist of several components that can be deployed into different containers such as WEB container, EJB container, WebServices container in a JEE5 server. This kind of deployment allows multi-tier applications that interact with one another to perform a given user task. Multi-tier JEE5 applications can be secured by properly selecting authenticating mechanisms and designing authorization levels or roles. If the application components use declarative security management, the authentication and authorization aspects are declared in corresponding JEE5 deployment descriptors. The declared security roles or levels are mapped to real security roles or levels in the geronimo deployment plans through security realms. In Apache Geronimo , the security realms abstract away authentication and authorization aspects of the application components. The authentication and authorization together enable access control for the various components of the application.
...