Author: dkatayev
Date: 2009-08-27 08:21:45 -0400 (Thu, 27 Aug 2009)
New Revision: 16
Added:
jcr/trunk/connectors/
jcr/trunk/connectors/jca/
jcr/trunk/connectors/jca/pom.xml
jcr/trunk/connectors/jca/src/
jcr/trunk/connectors/jca/src/main/
jcr/trunk/connectors/jca/src/main/java/
jcr/trunk/connectors/jca/src/main/java/org/
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/jcr/
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/jcr/adapters/
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/jcr/adapters/local/
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/jcr/adapters/local/JcrResourceAdapter.java
jcr/trunk/connectors/jca/src/main/rar/
jcr/trunk/connectors/jca/src/main/rar/META-INF/
jcr/trunk/connectors/jca/src/main/rar/META-INF/ra.xml
Log:
EXOJCR-2 jcr connectors trunk added
Added: jcr/trunk/connectors/jca/pom.xml
===================================================================
--- jcr/trunk/connectors/jca/pom.xml (rev 0)
+++ jcr/trunk/connectors/jca/pom.xml 2009-08-27 12:21:45 UTC (rev 16)
@@ -0,0 +1,166 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>config</artifactId>
+ <version>1.12-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>exo.jcr.connectors.localadapter</artifactId>
+ <packaging>rar</packaging>
+
+ <name>eXo JCR :: Component :: Resource Local Adapter</name>
+ <description>eXo JCR resource local adapter</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.xml.parsers</groupId>
+ <artifactId>jaxp-ri</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.ext</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.webdav</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.ftp</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.framework.command</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.framework.ftpclient</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.framework.web</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.frameworks.servlet</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <!-- We manually ask to create the JAR and it is automatically included
in the RAR -->
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-rar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Added:
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/jcr/adapters/local/JcrResourceAdapter.java
===================================================================
---
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/jcr/adapters/local/JcrResourceAdapter.java
(rev 0)
+++
jcr/trunk/connectors/jca/src/main/java/org/exoplatform/connectors/jcr/adapters/local/JcrResourceAdapter.java 2009-08-27
12:21:45 UTC (rev 16)
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.connectors.jcr.adapters.local;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+import java.net.MalformedURLException;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.xa.XAResource;
+
+/**
+ * Created by The eXo Platform SAS .
+ *
+ * @author <a href="mailto:lautarul@gmail.com">Roman Pedchenko</a>
+ * @version $Id: JcrResourceAdapter.java 7176 2006-07-19 07:59:47Z peterit $
+ */
+
+public class JcrResourceAdapter implements ResourceAdapter
+{
+
+ private static Log log = ExoLogger.getLogger("jcr.JcrResourceAdapter");
+
+ String containerConfig;
+
+ /*
+ * (non-Javadoc)
+ * @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
+ */
+ public synchronized void start(BootstrapContext ctx) throws
ResourceAdapterInternalException
+ {
+
+
System.out.println("<<<<<<<<<<<<<<<<<<
JcrResourceAdapter.start(), " + containerConfig + "
>>>>>>>>>>>>>>>>>>>");
+
+ log.info("Container config: " + containerConfig);
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+ try
+ {
+
+ if (containerConfig != null)
+ {
+ String url =
Thread.currentThread().getContextClassLoader().getResource(containerConfig).toString();
+ StandaloneContainer.addConfigurationURL(url);
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ log.warn("Invalid containerConfig URL, ignored: " + containerConfig);
+ e.printStackTrace();
+ }
+
+ try
+ {
+ StandaloneContainer sc = StandaloneContainer.getInstance();
+ }
+ catch (Exception e)
+ {
+ log.error("Standalone container start error: " + e);
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see javax.resource.spi.ResourceAdapter#stop()
+ */
+ public void stop()
+ {
+
System.out.println("<<<<<<<<<<<<<<<<<<
JcrResourceAdapter.stop(), " + containerConfig + "
>>>>>>>>>>>>>>>>>>>");
+ try
+ {
+ StandaloneContainer sc = StandaloneContainer.getInstance();
+ sc.stop();
+ }
+ catch (Exception e)
+ {
+ log.error("Standalone container stop error: " + e);
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
javax.resource.spi.ResourceAdapter#getXAResources(javax.resource.spi.ActivationSpec[])
+ */
+ public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
+ {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
@seejavax.resource.spi.ResourceAdapter#endpointActivation(javax.resource.spi.endpoint.
+ * MessageEndpointFactory, javax.resource.spi.ActivationSpec)
+ */
+ public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec
spec) throws ResourceException
+ {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
@seejavax.resource.spi.ResourceAdapter#endpointDeactivation(javax.resource.spi.endpoint.
+ * MessageEndpointFactory, javax.resource.spi.ActivationSpec)
+ */
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory,
ActivationSpec spec)
+ {
+ }
+
+ public void setContainerConfig(String prop)
+ {
+ this.containerConfig = prop;
+ }
+
+}
Added: jcr/trunk/connectors/jca/src/main/rar/META-INF/ra.xml
===================================================================
--- jcr/trunk/connectors/jca/src/main/rar/META-INF/ra.xml (rev 0)
+++ jcr/trunk/connectors/jca/src/main/rar/META-INF/ra.xml 2009-08-27 12:21:45 UTC (rev
16)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<connector version="1.5"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">
+ <description>JCR repository</description>
+ <display-name>JCR repository</display-name>
+ <vendor-name>exoplatform</vendor-name>
+ <eis-type />
+ <resourceadapter-version>1.11.3-SNAPSHOT</resourceadapter-version>
+ <license>
+ <license-required>false</license-required>
+ </license>
+ <resourceadapter>
+
<resourceadapter-class>org.exoplatform.connectors.jcr.adapters.local.JcrResourceAdapter</resourceadapter-class>
+ <config-property>
+ <description />
+ <config-property-name>containerConfig</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+
<!--<config-property-value>conf/exo-configuration.xml</config-property-value>-->
+ </config-property>
+ </resourceadapter>
+</connector>