servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoeh...@apache.org
Subject svn commit: r676487 [3/3] - in /servicemix/sandbox: cargo-container-servicemix/ cargo-container-servicemix/src/ cargo-container-servicemix/src/main/ cargo-container-servicemix/src/main/java/ cargo-container-servicemix/src/main/java/org/ cargo-container...
Date Mon, 14 Jul 2008 05:59:17 GMT
Added: servicemix/sandbox/cargo-container-servicemix/NOTICE
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/NOTICE?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/NOTICE (added)
+++ servicemix/sandbox/cargo-container-servicemix/NOTICE Sun Jul 13 22:59:16 2008
@@ -0,0 +1,198 @@
+   =========================================================================
+   ==  NOTICE file for use with the Apache License, Version 2.0,          ==
+   ==  in this case for the Apache ServiceMix distribution.               ==
+   =========================================================================
+
+   This product contains software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+
+
+=========================================================================
+==  Bouncy Castle Notice                                               ==
+=========================================================================
+
+This product includes software (the ASN1 codec in the org.apache.geronimo.asn1
+package) which was developed by the Bouncy Castle project. 
+(http://www.bouncycastle.org/) 
+
+     Copyright (c) 2000-2005 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
+
+=========================================================================
+==  Derby Notice                                                       ==
+=========================================================================
+
+Portions of Derby were orginally developed by
+International Business Machines Corporation and are
+licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement",
+informally known as the "Derby CLA".
+
+The portion of the functionTests under 'nist' was originally 
+developed by the National Institute of Standards and Technology (NIST), 
+an agency of the United States Department of Commerce, and adapted by
+International Business Machines Corporation in accordance with the NIST
+Software Acknowledgment and Redistribution document at
+http://www.itl.nist.gov/div897/ctg/sql_form.htm
+
+
+=========================================================================
+==  Spring Notice                                                      ==
+=========================================================================
+
+This product includes software developed by
+the Apache Software Foundation (http://www.apache.org).
+
+This product also includes software developed by
+Clinton Begin (http://www.ibatis.com).
+
+The end-user documentation included with a redistribution, if any,
+must include the following acknowledgement:
+
+ "This product includes software developed by the Spring Framework
+  Project (http://www.springframework.org)."
+
+Alternately, this acknowledgement may appear in the software itself,
+if and wherever such third-party acknowledgements normally appear.
+
+The names "Spring" and "Spring Framework" must not be used to
+endorse or promote products derived from this software without
+prior written permission. For written permission, please contact
+rod.johnson@interface21.com or juergen.hoeller@interface21.com.
+   
+=========================================================================
+==  MX4J Notice                                                        ==
+=========================================================================
+
+This product includes software developed by the MX4J project 
+(http://sourceforge.net/projects/mx4j).
+
+
+=========================================================================
+==  WSDL4J Notice                                                      ==
+=========================================================================
+
+The Program includes all or portions of the following software which is 
+subject to the Common Public License ("CPL Code").  This software 
+consists of voluntary contributions made by many individuals on behalf of
+the WSDL4J project.
+
+You may download the source version of the WSDL4J component at 
+http://sourceforge.net/projects/wsdl4j
+
+
+=========================================================================
+==  Xerces Notice                                                      ==
+=========================================================================
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+  - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+  - voluntary contributions made by Paul Eng on behalf of the 
+    Apache Software Foundation that were originally developed at 
+    iClick, Inc., software copyright (c) 1999.
+
+
+=========================================================================
+==  XmlBeans Notice                                                    ==
+=========================================================================
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+Aside from contributions to the Apache XMLBeans project, this
+software also includes:
+
+ - one or more source files from the Apache Xerces-J and Apache Axis
+   products, Copyright (c) 1999-2003 Apache Software Foundation
+
+ - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
+   Consortium (Massachusetts Institute of Technology, European Research
+   Consortium for Informatics and Mathematics, Keio University)
+
+ - resolver.jar from Apache Xml Commons project,
+   Copyright (c) 2001-2003 Apache Software Foundation
+
+ - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
+   Copyright 2002 Yuval Oren under the terms of the Apache Software 
+   License 2.0
+
+
+=========================================================================
+==  XmlSecurity Notice                                                 ==
+=========================================================================
+
+It was originally based on software copyright (c) 2001, Institute for
+Data Communications Systems, <http://www.nue.et-inf.uni-siegen.de/>.
+
+The development of this software was partly funded by the European 
+Commission in the <WebSig> project in the ISIS Programme. 
+
+=========================================================================
+==  OpenSaml Notice                                                    ==
+=========================================================================
+
+We wish to acknowledge the following copyrighted works that make up
+portions of this software:
+
+This product includes software developed by the Apache Software
+Foundation (http://www.apache.org/).
+
+We also thank Tom Scavo for donating the original SAML artifact
+implementation.
+
+
+   This following notices refer to portions of this
+   software.
+
+
+=========================================================================
+==  W3C Notice                                                         ==
+=========================================================================
+
+W3C® DOCUMENT LICENSE
+http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
+
+Public documents on the W3C site are provided by the copyright holders under the following license. By using and/or copying this document, or the W3C document from which this statement is linked, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:
+
+Permission to copy, and distribute the contents of this document, or the W3C document from which this statement is linked, in any medium for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the document, or portions thereof, that you use:
+
+   1. A link or URL to the original W3C document.
+   2. The pre-existing copyright notice of the original author, or if it doesn't exist, a notice (hypertext is preferred, but a textual representation is permitted) of the form: "Copyright © [$date-of-document] World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231"
+   3. If it exists, the STATUS of the W3C document.
+
+When space permits, inclusion of the full text of this NOTICE should be provided. We request that authorship attribution be provided in any software, documents, or other items or products that you create pursuant to the implementation of the contents of this document, or any portion thereof.
+
+No right to create modifications or derivatives of W3C documents is granted pursuant to this license. However, if additional requirements (documented in the Copyright FAQ) are satisfied, the right to create modifications or derivatives is sometimes granted by the W3C to individuals complying with those requirements.
+
+THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.
+
+The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to this document or its contents without specific, written prior permission. Title to copyright in this document will at all times remain with copyright holders.
+
+----------------------------------------------------------------------------
+
+This formulation of W3C's notice and license became active on December 31 2002. This version removes the copyright ownership notice such that this license can be used with materials other than those owned by the W3C, moves information on style sheets, DTDs, and schemas to the Copyright FAQ, reflects that ERCIM is now a host of the W3C, includes references to this specific dated version of the license, and removes the ambiguous grant of "use". See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, such as the translating or annotating specifications. Other questions about this notice can be directed to site-policy@w3.org.
+
+Joseph Reagle <site-policy@w3.org>
+
+Last revised $Id: copyright-documents-20021231.html,v 1.6 2004/07/06 16:02:49 slesch Exp $
+
+
+=========================================================================
+==  OASIS Notice                                                       ==
+=========================================================================
+
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS Executive Director.
+
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director.
+
+Copyright (C) OASIS Open (2004-2005). All Rights Reserved.
+
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English. 
+
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns. 
+
+This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Added: servicemix/sandbox/cargo-container-servicemix/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/pom.xml?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/pom.xml (added)
+++ servicemix/sandbox/cargo-container-servicemix/pom.xml Sun Jul 13 22:59:16 2008
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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">
+
+	<!--
+		
+		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.
+	-->
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.servicemix</groupId>
+		<artifactId>servicemix-pom</artifactId>
+		<version>1.0</version>
+	</parent>
+
+	<groupId>org.apache.servicemix.tooling</groupId>
+	<artifactId>cargo-container-servicemix</artifactId>
+	<version>1.0-SNAPSHOT</version>
+	<name>Cargo ServiceMix Container</name>
+	<packaging>jar</packaging>
+
+	<description>Implementation for ServiceMix containers</description>
+
+	<properties>
+		<cargo-version>1.0-alpha-5</cargo-version>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.codehaus.cargo</groupId>
+			<artifactId>cargo-core-api-generic</artifactId>
+			<version>${cargo-version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.codehaus.cargo</groupId>
+			<artifactId>cargo-core-api-container</artifactId>
+			<version>${cargo-version}</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.codehaus.cargo</groupId>
+			<artifactId>cargo-core-api-util</artifactId>
+			<version>${cargo-version}</version>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.servicemix</groupId>
+				<artifactId>servicemix-build</artifactId>
+				<version>1.0</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>copy</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-checkstyle-plugin</artifactId>
+				<dependencies>
+					<dependency>
+						<groupId>org.apache.servicemix</groupId>
+						<artifactId>servicemix-build</artifactId>
+						<version>1.0</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

Added: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalContainer.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalContainer.java?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalContainer.java (added)
+++ servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalContainer.java Sun Jul 13 22:59:16 2008
@@ -0,0 +1,74 @@
+/*
+ * 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.servicemix.cargo.container;
+
+import java.io.FileNotFoundException;
+
+import org.apache.servicemix.cargo.container.internal.AbstractServiceMixInstalledLocalContainer;
+import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.types.Path;
+import org.codehaus.cargo.container.configuration.LocalConfiguration;
+
+/**
+ * Special container support for the ServiceMix 3.x jbi container.
+ * 
+ * @version $Revision$
+ */
+public class ServiceMix3xInstalledLocalContainer extends AbstractServiceMixInstalledLocalContainer
+{
+    /**
+     * Unique container id.
+     */
+    public static final String ID = "servicemix3x";
+
+    /**
+     * {@inheritDoc}
+     * @see AbstractServiceMixInstalledLocalContainer#AbstractInstalledLocalContainer(org.codehaus.cargo.container.configuration.LocalConfiguration)
+     */
+    public ServiceMix3xInstalledLocalContainer(LocalConfiguration configuration)
+    {
+        super(configuration);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see AbstractServiceMixInstalledLocalContainer#startUpAdditions(Java, Path)
+     */
+    protected void startUpAdditions(Java theJavaContainer, Path theClasspath)
+        throws FileNotFoundException
+    {
+        // Nothing additional required
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see org.codehaus.cargo.container.Container#getId()
+     */
+    public final String getId()
+    {
+        return ID;
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see org.codehaus.cargo.container.Container#getName()
+     */
+    public String getName()
+    {
+        return "ServiceMix " + getVersion("3.x");
+    }    
+}

Propchange: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalContainer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalDeployer.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalDeployer.java?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalDeployer.java (added)
+++ servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalDeployer.java Sun Jul 13 22:59:16 2008
@@ -0,0 +1,60 @@
+/*
+ * 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.servicemix.cargo.container;
+
+import org.apache.servicemix.cargo.container.internal.ServiceMixJMXUtil;
+import org.codehaus.cargo.container.InstalledLocalContainer;
+import org.codehaus.cargo.container.deployable.Deployable;
+import org.codehaus.cargo.container.spi.deployer.AbstractInstalledLocalDeployer;
+
+/**
+ * Local deployer for ServiceMix3.
+ * 
+ * @version $Revision$
+ */
+public class ServiceMix3xInstalledLocalDeployer extends AbstractInstalledLocalDeployer 
+{
+
+    /**
+     * Hot-Deploy-Directory.
+     */
+    private String deployDir;
+
+    /**
+     * Constructor.
+     * 
+     * @param container container
+     */
+    public ServiceMix3xInstalledLocalDeployer(InstalledLocalContainer container) 
+    {
+        super(container);
+        deployDir = container.getHome() + "/hotdeploy";
+    }
+
+    /**
+     * Deploy a file to ServiceMix.
+     * 
+     * @param deployable deplyoable.
+     */
+    public void deploy(Deployable deployable) 
+    {
+
+        ServiceMixJMXUtil.deploy(getFileHandler().getURL(deployable.getFile()));
+                
+    }
+
+}

Propchange: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xInstalledLocalDeployer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java (added)
+++ servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java Sun Jul 13 22:59:16 2008
@@ -0,0 +1,72 @@
+/*
+ * 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.servicemix.cargo.container;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.codehaus.cargo.container.LocalContainer;
+import org.codehaus.cargo.container.configuration.ConfigurationCapability;
+import org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration;
+
+/**
+ * ServiceMix {@link org.codehaus.cargo.container.configuration.Configuration} implementation.
+ *  
+ * @version $Revision$
+ */
+public class ServiceMix3xStandaloneLocalConfiguration extends AbstractStandaloneLocalConfiguration
+{
+    /**
+     * constructor.
+     * 
+     * @param dir directory
+     */
+    public ServiceMix3xStandaloneLocalConfiguration(String dir) 
+    {
+        super(dir);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void doConfigure(LocalContainer arg0) throws Exception 
+    {
+        
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public ConfigurationCapability getCapability() 
+    {
+        return new ConfigurationCapability() 
+        {
+        
+            public boolean supportsProperty(String arg0) 
+            {
+                return false;
+            }
+        
+            public Map getProperties() 
+            {
+                return Collections.EMPTY_MAP;
+            }
+        
+        };
+    }
+
+}

Propchange: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMix3xStandaloneLocalConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMixDeployable.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMixDeployable.java?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMixDeployable.java (added)
+++ servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMixDeployable.java Sun Jul 13 22:59:16 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.servicemix.cargo.container;
+
+import org.codehaus.cargo.container.deployable.DeployableType;
+import org.codehaus.cargo.container.spi.deployable.AbstractDeployable;
+
+/**
+ * ServiceMixDeployable.
+ * 
+ * @version $Revision$
+ */
+public class ServiceMixDeployable extends AbstractDeployable {
+
+    /**
+     * Constructor.
+     * 
+     * @param name Name
+     */
+    public ServiceMixDeployable(String name) {
+        super(name);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public DeployableType getType() {
+        return DeployableType.FILE;
+    }
+
+}

Propchange: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/ServiceMixDeployable.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java (added)
+++ servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java Sun Jul 13 22:59:16 2008
@@ -0,0 +1,235 @@
+/*
+ * 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.servicemix.cargo.container.internal;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileNotFoundException;
+import java.util.jar.JarFile;
+
+import org.apache.tools.ant.taskdefs.Java;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.codehaus.cargo.container.ContainerCapability;
+import org.codehaus.cargo.container.configuration.LocalConfiguration;
+import org.codehaus.cargo.container.internal.AntContainerExecutorThread;
+import org.codehaus.cargo.container.spi.AbstractInstalledLocalContainer;
+
+/**
+ * Common support for all ServiceMix container versions.
+ * 
+ * @version $Revision$
+ */
+public abstract class AbstractServiceMixInstalledLocalContainer 
+                extends AbstractInstalledLocalContainer
+{
+    /**
+     * Parsed version of the container.
+     */
+    private String version;
+
+    /**
+     * Capability of the ServiceMix container.
+     */
+    private ContainerCapability capability = new JBIContainerCabability();
+
+    private AntContainerExecutorThread serviceMixRunner;
+    
+    /**
+     * {@inheritDoc}
+     * @see AbstractInstalledLocalContainer#AbstractInstalledLocalContainer(LocalConfiguration)
+     */
+    public AbstractServiceMixInstalledLocalContainer(LocalConfiguration configuration)
+    {
+        super(configuration);
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see org.codehaus.cargo.container.Container#getCapability()
+     */
+    public ContainerCapability getCapability()
+    {
+        return this.capability;
+    }
+
+    /**
+     * {@inheritDoc}
+     * @see AbstractInstalledLocalContainer#doStart(Java)
+     */
+    public void doStart(Java java) throws Exception
+    {
+        Path classpath = doAction(java);
+
+        // Add settings specific to a given container version
+        startUpAdditions(java, classpath);
+
+        serviceMixRunner = new AntContainerExecutorThread(java);
+        serviceMixRunner.start();
+
+    }
+    
+    /**
+     * {@inheritDoc}
+     * @see AbstractInstalledLocalContainer#doStop(Java)
+     */
+    public void doStop(Java java) throws Exception
+    {
+        ServiceMixJMXUtil.shutdownServer();
+    }
+
+    /**
+     * Common Ant Java task settings for start and stop actions.
+     *
+     * @param java the Ant Java object passed by the Cargo underlying container SPI classes
+     * @return the classpath set (this is required as strangely there's no way to query the Ant
+     *         Java object for the classapth after it's set)
+     */
+    private Path doAction(Java java)
+    {
+        java.setDir(new File(getHome()));
+        
+        // Invoke the main class to start the container
+        java.addSysproperty(getAntUtils().createSysProperty("servicemix.home",
+            "."));
+
+        java.addSysproperty(getAntUtils().createSysProperty("classworlds.conf",
+            "conf/servicemix.conf"));
+        
+        java.addSysproperty(getAntUtils().createSysProperty("java.endorsed.dirs",
+            "lib/endorsed"));
+        
+        java.setClassname("org.codehaus.classworlds.Launcher");
+
+        Path classpath = java.createClasspath();
+        
+        FileSet fileSet = new FileSet();
+        fileSet.setDir(new File(getHome()));
+        fileSet.createInclude().setName("lib/*.jar");
+        classpath.addFileset(fileSet);
+
+        return classpath;
+    }
+
+    /**
+     * Allow specific version implementations to add custom settings to the 
+     * Java container that will be started.
+     * 
+     * @param javaContainer the Ant Java object that will start the container
+     * @param classpath the classpath that will be used to start the 
+     *        container
+     * @throws FileNotFoundException in case the Tools jar cannot be found
+     */
+    protected abstract void startUpAdditions(Java javaContainer, Path classpath) 
+        throws FileNotFoundException;
+
+    /**
+     * @param defaultVersion default version to use if we cannot find out the exact version
+     * @return the version found
+     */
+    protected String getVersion(String defaultVersion)
+    {
+        String version = this.version;
+        
+        if (version == null)
+        {
+            try
+            {
+                File[] listFiles = new File(getHome(), "/lib").listFiles(new FileFilter() {
+                
+                    public boolean accept(File file) 
+                    {
+                        return file.getName().startsWith("servicemix-core");
+                    }
+                
+                });
+                
+                JarFile jarFile = new JarFile(listFiles[0]);
+                
+                version = jarFile.getManifest().getMainAttributes()
+                            .getValue("Implementation-Version");
+                
+                getLogger().info("Found ServiceMix version [" + version + "]",
+                    this.getClass().getName());
+            }
+            catch (Exception e)
+            {
+                getLogger().debug("Failed to get ServiceMix version, Error = [" + e.getMessage()
+                    + "]. Using generic version [" + defaultVersion + "]", 
+                    this.getClass().getName());
+                version = defaultVersion;
+            }
+        }
+        this.version = version;
+        return version;
+    }
+    
+    protected void waitForCompletion(boolean waitForStarting) throws InterruptedException {
+        
+        
+        if (waitForStarting)
+        {
+            waitForContainerStart();
+        }
+        
+    }
+     
+    private void waitForContainerStart()
+    {
+        int retryCount = 60;
+        
+        Object serverState = null;
+        
+        while ((serverState == null || !serverState.equals("Started")) || retryCount == 0) 
+        {
+            try {
+                
+                Thread.sleep(1000);
+                retryCount--;
+                
+                serverState = ServiceMixJMXUtil.getServerState();
+                
+                getLogger().debug("state from smx host: " + serverState, 
+                                  this.getClass().getName());
+                
+            } catch (Exception e) {
+                //ignore
+            }
+            
+        }
+        
+        if (serverState == null) 
+        {
+            throw new RuntimeException("could not connect to server");
+        }
+        
+        //wait for 'all' deployments
+        try {
+            int oldDeploymentCount = ServiceMixJMXUtil.getDeploymentCount();
+            int newDeploymentCount = -1;
+            while ((oldDeploymentCount != newDeploymentCount) || newDeploymentCount == -1) {
+                oldDeploymentCount = ServiceMixJMXUtil.getDeploymentCount();
+                Thread.sleep(5000);
+                newDeploymentCount = ServiceMixJMXUtil.getDeploymentCount();
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        
+    }
+    
+}

Propchange: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/AbstractServiceMixInstalledLocalContainer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/JBIContainerCabability.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/JBIContainerCabability.java?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/JBIContainerCabability.java (added)
+++ servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/JBIContainerCabability.java Sun Jul 13 22:59:16 2008
@@ -0,0 +1,48 @@
+/*
+ * 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.servicemix.cargo.container.internal;
+
+import org.codehaus.cargo.container.ContainerCapability;
+import org.codehaus.cargo.container.deployable.DeployableType;
+
+/**
+ * Capability for JBI containers.
+ * 
+ * @version $Revision$
+ */
+public class JBIContainerCabability implements ContainerCapability 
+{
+
+    /**
+     * {@inheritDoc}
+     * @see ContainerCapability#supportsDeployableType(org.codehaus.cargo.container.deployable.DeployableType)
+     */
+    public boolean supportsDeployableType(DeployableType type) 
+    {
+ 
+        boolean supported = false;
+        
+        if (type == DeployableType.FILE)
+        {
+            supported = true;
+        }
+        
+        return supported;
+        
+    }
+
+}

Propchange: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/JBIContainerCabability.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java (added)
+++ servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java Sun Jul 13 22:59:16 2008
@@ -0,0 +1,107 @@
+/*
+ * 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.servicemix.cargo.container.internal;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+/**
+ * 
+ * @version $Revision$
+ */
+public final class ServiceMixJMXUtil {
+
+    private static String containerName = "org.apache.servicemix:ContainerName=ServiceMix,Type=JBIContainer";
+    
+    private static MBeanServerConnection getServerConnection() throws MalformedURLException, IOException 
+    {
+        
+        String jndiPath = "jmxrmi";
+        String urlstring = "service:jmx:rmi:///jndi/rmi://localhost:1099/" + jndiPath;
+        JMXServiceURL url = new JMXServiceURL(urlstring) ;
+         
+        String username ="smx";
+        String password="smx";
+        Map map = new HashMap();
+        map.put("jmx.remote.credentials", new String[] {username, password});
+         
+        JMXConnector connector = JMXConnectorFactory.connect(url, map);
+         
+        MBeanServerConnection serverConnection = connector.getMBeanServerConnection();
+        return serverConnection;
+        
+    }
+    
+    public static String getServerState() throws Exception {
+        return (String)getServerConnection().getAttribute(new ObjectName(containerName), "currentState");
+    }
+    
+    public static void shutdownServer() throws Exception {
+        getServerConnection().invoke(new ObjectName(containerName), "shutDown", new Object[]{} , new String[]{});
+    }
+     
+    public static int getDeploymentCount() throws Exception {
+        
+        int count = 0;
+        
+        MBeanServerConnection serverConnection = getServerConnection();
+        
+        Set queryMBeans = serverConnection.queryMBeans(new ObjectName("org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,*"), null);
+        count += queryMBeans.size();
+        
+        queryMBeans = serverConnection.queryMBeans(new ObjectName("org.apache.servicemix:ContainerName=ServiceMix,Type=SharedLibrary,*"), null);
+        count += queryMBeans.size();
+        
+        queryMBeans = serverConnection.queryMBeans(new ObjectName("org.apache.servicemix:ContainerName=ServiceMix,Type=ServiceAssembly,*"), null);
+        count += queryMBeans.size();
+        
+        queryMBeans = serverConnection.queryMBeans(new ObjectName("org.apache.servicemix:ContainerName=ServiceMix,Type=ServiceUnit,*"), null);
+        count += queryMBeans.size();
+        
+        queryMBeans = serverConnection.queryMBeans(new ObjectName("org.apache.servicemix:ContainerName=ServiceMix,Type=Component,*"), null);
+        count += queryMBeans.size();
+        
+        return count;
+        
+    }
+    
+    public static void deploy(String filename) {
+        
+        try {
+            
+            getServerConnection().invoke(new ObjectName("org.apache.servicemix:ContainerName=ServiceMix,Type=SystemService,Name=AdminCommandsService"), "installArchive", new Object[]{filename}, new String[]{String.class.getName()});
+            
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        
+    }
+    
+}

Propchange: servicemix/sandbox/cargo-container-servicemix/src/main/java/org/apache/servicemix/cargo/container/internal/ServiceMixJMXUtil.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: servicemix/sandbox/cargo-sample/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/sandbox/cargo-sample/pom.xml?rev=676487&view=auto
==============================================================================
--- servicemix/sandbox/cargo-sample/pom.xml (added)
+++ servicemix/sandbox/cargo-sample/pom.xml Sun Jul 13 22:59:16 2008
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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>
+    <groupId>org.apache.servicemix.tooling</groupId>
+    <artifactId>cargo-test</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <name>Cargo Core Containers</name>
+    <packaging>jar</packaging>
+
+    <properties>
+        <servicemix-version>3.2.1</servicemix-version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.servicemix.samples</groupId>
+            <artifactId>camel-sa</artifactId>
+            <type>zip</type>
+            <version>${servicemix-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.servicemix</groupId>
+            <artifactId>apache-servicemix</artifactId>
+            <type>tar.gz</type>
+            <version>${servicemix-version}</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.cargo</groupId>
+                <artifactId>cargo-maven2-plugin</artifactId>
+                <version>1.0-alpha-5</version>
+                <executions>
+                    <execution>
+                        <id>start-container</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>start</goal>
+                        </goals>
+                        <configuration>
+                            <wait>false</wait>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>deploy-into-container</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                            <goal>deploy</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>stop-container</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+
+                </executions>
+                <configuration>
+                    <container>
+                        <containerId>servicemix3x</containerId>
+                        <zipUrlInstaller>
+                            <url>
+                                file:${settings.localRepository}/org/apache/servicemix/apache-servicemix/${servicemix-version}/apache-servicemix-${servicemix-version}.tar.gz
+                            </url>
+                            <installDir>servicemix3</installDir>
+                        </zipUrlInstaller>
+                        <implementation>
+                            org.apache.servicemix.cargo.container.ServiceMix3xInstalledLocalContainer
+                        </implementation>
+                    </container>
+                    <configuration>
+                        <type>standalone</type>
+                        <implementation>
+                            org.apache.servicemix.cargo.container.ServiceMix3xStandaloneLocalConfiguration
+                        </implementation>
+                    </configuration>
+
+                    <deployer>
+                        <implementation>
+                            org.apache.servicemix.cargo.container.ServiceMix3xInstalledLocalDeployer
+                        </implementation>
+                        <type>installed</type>
+                        <deployables>
+                            <deployable>
+                                <groupId>
+                                    org.apache.servicemix.samples
+                                </groupId>
+                                <artifactId>camel-sa</artifactId>
+                                <type>zip</type>
+                                <implementation>
+                                    org.apache.servicemix.cargo.container.ServiceMixDeployable
+                                </implementation>
+                            </deployable>
+                        </deployables>
+                    </deployer>
+
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.servicemix.tooling</groupId>
+                        <artifactId>
+                            cargo-container-servicemix
+                        </artifactId>
+                        <version>1.0-SNAPSHOT</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
+
+
+</project>



Mime
View raw message