Skip to content

Commit

Permalink
Add default DataSource integration for JAXR subsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Diesler authored and bstansberry committed Nov 8, 2011
1 parent 34e7590 commit 7a05c81
Show file tree
Hide file tree
Showing 10 changed files with 1,137 additions and 135 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<module xmlns="urn:jboss:module:1.0" name="jaxr">
<module xmlns="urn:jboss:module:1.0" name="org.jboss.as.jaxr">
<resources>
<!-- Insert resources here -->
</resources>

<dependencies>
<module name="javax.api"/>
<module name="org.jboss.staxmapper"/>
<module name="org.jboss.as.controller"/>
<module name="org.jboss.as.naming"/>
<module name="org.jboss.as.server"/>
<module name="org.jboss.modules"/>
<module name="org.jboss.msc"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.vfs"/>
<module name="org.jboss.msc"/>
<module name="org.jboss.staxmapper"/>
</dependencies>
</module>
33 changes: 33 additions & 0 deletions build/src/main/resources/standalone/configuration/standalone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<extension module="org.jboss.as.ee"/>
<extension module="org.jboss.as.ejb3"/>
<extension module="org.jboss.as.jacorb"/>
<extension module="org.jboss.as.jaxr"/>
<extension module="org.jboss.as.jaxrs"/>
<extension module="org.jboss.as.jmx"/>
<extension module="org.jboss.as.jpa"/>
Expand Down Expand Up @@ -184,6 +185,38 @@
</cache-container>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jacorb:1.1"/>
<orb name="JBoss" print-version="off" giop-minor-version="2">
<connection max-managed-buf-size="24" outbuf-cache-timeout="-1"/>
<naming root-context="JBoss/Naming/root" export-corbaloc="on"/>
</orb>
<poa monitoring="off" queue-wait="off">
<request-processors pool-size="2" max-threads="8"/>
</poa>
<interop sun="on" chunk-custom-rmi-valuetypes="on" strict-check-on-tc-creation="off"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jaxr:1.0">
<!--
<!- - Whether we want to run the db initialization scripts - ->
<!- - Should all tables be created on Start- ->
<attribute name="CreateOnStart">false</attribute>
<!- - Should all tables be dropped on Stop- ->
<attribute name="DropOnStop">false</attribute>
<!- - Should all tables be dropped on Start- ->
<attribute name="DropOnStart">false</attribute>
<!- - Datasource to Database- ->
<attribute name="DataSourceUrl">java:/DefaultDS</attribute>
<!- - Alias to the registry- ->
<attribute name="RegistryOperator">RegistryOperator</attribute>
<!- - Should I bind a Context to which JaxrConnectionFactory bound- ->
<attribute name="ShouldBindJaxr">true</attribute>
<!- - Context to which JaxrConnectionFactory to bind to.
If you have remote clients, please bind it to the global
namespace(default behavior). To just cater to clients running
on the same VM as JBoss, change to java:/JAXR - ->
<attribute name="BindJaxr">JAXR</attribute>
<attribute name="DropDB">false</attribute>
-->
</subsystem>
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.0">
<archive-validation enabled="false"/>
Expand Down
44 changes: 6 additions & 38 deletions jaxr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>jboss-as-parent</artifactId>
<groupId>org.jboss.as</groupId>
Expand All @@ -31,52 +32,15 @@

<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-jaxr</artifactId>
<version>7.1.0.Alpha2-SNAPSHOT</version>
<packaging>jar</packaging>

<name>JBoss Application Server: JAXR Subsystem</name>

<packaging>jar</packaging>

<properties>
</properties>


<build>
<plugins>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<enableAssertions>true</enableAssertions>
<argLine>-Xmx512m</argLine>
<systemProperties>
<property>
<name>jboss.home</name>
<value>${jboss.home}</value>
</property>
</systemProperties>
<includes>
<include>**/*TestCase.java</include>
</includes>
<forkMode>once</forkMode>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<filters>
<filter>src/assemble/filter.properties</filter>
</filters>
<descriptors>
<descriptor>src/assemble/distribution.xml</descriptor>
</descriptors>
</configuration>
</plugin>
-->
</plugins>
</build>

Expand All @@ -85,6 +49,10 @@
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-controller</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-naming</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-server</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package org.jboss.as.jaxr.extension;

import java.util.List;

import org.jboss.as.controller.AbstractBoottimeAddStepHandler;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.OperationStepHandler;
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.jaxr.service.JAXRServerService;
import org.jboss.as.server.AbstractDeploymentChainStep;
import org.jboss.as.server.DeploymentProcessorTarget;
import org.jboss.as.jaxr.service.JAXRConfiguration;
import org.jboss.as.jaxr.service.JUDDIService;
import org.jboss.dmr.ModelNode;
import org.jboss.logging.Logger;
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceTarget;

import java.util.List;

/**
* Handler responsible for adding the subsystem resource to the model
*
Expand All @@ -25,8 +23,6 @@ class JAXRSubsystemAdd extends AbstractBoottimeAddStepHandler {

static final JAXRSubsystemAdd INSTANCE = new JAXRSubsystemAdd();

private final Logger log = Logger.getLogger(JAXRSubsystemAdd.class);

private JAXRSubsystemAdd() {
}

Expand All @@ -43,8 +39,10 @@ public void performBoottime(final OperationContext context, final ModelNode oper
context.addStep(new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
// [TODO] AS7-2278 JAXR configuration through the domain model
JAXRConfiguration config = new JAXRConfiguration();
ServiceTarget serviceTarget = context.getServiceTarget();
newControllers.add(JAXRServerService.addService(serviceTarget));
newControllers.add(JUDDIService.addService(serviceTarget, config));
context.completeStep();
}
}, OperationContext.Stage.RUNTIME);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2010, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/

package org.jboss.as.jaxr.service;

import org.jboss.msc.service.ServiceName;

/**
* The configuration of the JAXR subsystem.
*
* [TODO] AS7-2278 JAXR configuration through the domain model
*
* @author Thomas.Diesler@jboss.com
* @since 26-Oct-2011
*/
public class JAXRConfiguration {

public static final ServiceName SERVICE_BASE_NAME = ServiceName.JBOSS.append("jaxr", "as");
public static final ServiceName JUDDI_SERVICE_NAME = SERVICE_BASE_NAME.append("service");

// Should all tables be created on Start
private boolean createOnStart=true;
// Should all tables be dropped on Stop
private boolean dropOnStop=true;
// Should all tables be dropped on Start
private boolean dropOnStart=true;
// Datasource to Database
private String dataSourceUrl="java:jboss/datasources/ExampleDS";
// Alias to the registry
private String registryOperator="RegistryOperator";
// Should I bind a Context to which JaxrConnectionFactory bound
private boolean bindJaxr=true;
// Context to which JaxrConnectionFactory to bind to
private String namingContext ="java:/JAXR";

boolean isDropOnStop() {
return dropOnStop;
}

boolean isDropOnStart() {
return dropOnStart;
}

String getDataSourceUrl() {
return dataSourceUrl;
}

String getRegistryOperator() {
return registryOperator;
}

boolean isBindJaxr() {
return bindJaxr;
}

String getNamingContext() {
return namingContext;
}

boolean isCreateOnStart() {
return createOnStart;
}
}

This file was deleted.

Loading

0 comments on commit 7a05c81

Please sign in to comment.