geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r158417 - in geronimo/trunk: configs/ configs/geronimo-gbean-deployer/ configs/geronimo-gbean-deployer/src/ configs/geronimo-gbean-deployer/src/plan/ plugins/geronimo-packaging-plugin/ plugins/geronimo-packaging-plugin/src/ plugins/geronimo-packaging-plugin/src/java/ plugins/geronimo-packaging-plugin/src/java/org/ plugins/geronimo-packaging-plugin/src/java/org/apache/ plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/ plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/ plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/
Date Mon, 21 Mar 2005 07:25:50 GMT
Author: jboynes
Date: Sun Mar 20 23:25:45 2005
New Revision: 158417

URL: http://svn.apache.org/viewcvs?view=rev&rev=158417
Log:
experimental plugin for building configurations directly in Maven

Added:
    geronimo/trunk/configs/
    geronimo/trunk/configs/geronimo-gbean-deployer/   (with props)
    geronimo/trunk/configs/geronimo-gbean-deployer/LICENSE.txt   (with props)
    geronimo/trunk/configs/geronimo-gbean-deployer/NOTICE.txt   (with props)
    geronimo/trunk/configs/geronimo-gbean-deployer/maven.xml   (with props)
    geronimo/trunk/configs/geronimo-gbean-deployer/project.properties   (with props)
    geronimo/trunk/configs/geronimo-gbean-deployer/project.xml   (with props)
    geronimo/trunk/configs/geronimo-gbean-deployer/src/
    geronimo/trunk/configs/geronimo-gbean-deployer/src/plan/
    geronimo/trunk/configs/geronimo-gbean-deployer/src/plan/plan.xml   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/LICENSE.txt   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/NOTICE.txt   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/maven.xml   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/AbstractDistributor.java   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/JMXDistributor.java   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java   (with props)
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java   (with props)

Propchange: geronimo/trunk/configs/geronimo-gbean-deployer/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Mar 20 23:25:45 2005
@@ -0,0 +1,6 @@
+*.iml
+.project
+.classpath
+maven.log
+junit*.properties
+target

Added: geronimo/trunk/configs/geronimo-gbean-deployer/LICENSE.txt
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/geronimo-gbean-deployer/LICENSE.txt?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/configs/geronimo-gbean-deployer/LICENSE.txt (added)
+++ geronimo/trunk/configs/geronimo-gbean-deployer/LICENSE.txt Sun Mar 20 23:25:45 2005
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+

Propchange: geronimo/trunk/configs/geronimo-gbean-deployer/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/configs/geronimo-gbean-deployer/NOTICE.txt
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/geronimo-gbean-deployer/NOTICE.txt?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/configs/geronimo-gbean-deployer/NOTICE.txt (added)
+++ geronimo/trunk/configs/geronimo-gbean-deployer/NOTICE.txt Sun Mar 20 23:25:45 2005
@@ -0,0 +1,3 @@
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Propchange: geronimo/trunk/configs/geronimo-gbean-deployer/NOTICE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/configs/geronimo-gbean-deployer/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/geronimo-gbean-deployer/maven.xml?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/configs/geronimo-gbean-deployer/maven.xml (added)
+++ geronimo/trunk/configs/geronimo-gbean-deployer/maven.xml Sun Mar 20 23:25:45 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project default="geronimo:install">
+</project>
\ No newline at end of file

Propchange: geronimo/trunk/configs/geronimo-gbean-deployer/maven.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/configs/geronimo-gbean-deployer/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/geronimo-gbean-deployer/project.properties?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/configs/geronimo-gbean-deployer/project.properties (added)
+++ geronimo/trunk/configs/geronimo-gbean-deployer/project.properties Sun Mar 20 23:25:45 2005
@@ -0,0 +1,28 @@
+##
+##
+##   Copyright 2005 The Apache Software Foundation
+##
+##   Licensed 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.
+##
+
+##
+## $Rev$ $Date$
+##
+
+# use personal repo at Apache until we are prepared to release this
+maven.repo.remote= http://cvs.apache.org/~jboynes, http://www.ibiblio.org/maven
+
+# override deploymentConfig to use bootstrap configuration
+geronimo.packaging.deploymentConfig=geronimo/cars/geronimo-gbean-deployer-0.1.car
+
+geronimo_version=1.0-SNAPSHOT
\ No newline at end of file

Propchange: geronimo/trunk/configs/geronimo-gbean-deployer/project.properties
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/configs/geronimo-gbean-deployer/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/geronimo-gbean-deployer/project.xml?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/configs/geronimo-gbean-deployer/project.xml (added)
+++ geronimo/trunk/configs/geronimo-gbean-deployer/project.xml Sun Mar 20 23:25:45 2005
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project>
+    <pomVersion>3</pomVersion>
+    <groupId>geronimo</groupId>
+    <id>geronimo-gbean-deployer</id>
+    <name>Geronimo Configuration for service deployments</name>
+    <currentVersion>SNAPSHOT</currentVersion>
+
+    <dependencies>
+        <!-- dependencies referenced in plan -->
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
+            <version>${geronimo_version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee</artifactId>
+            <version>${geronimo_version}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${geronimo_version}</version>
+        </dependency>
+        <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xbean-apache</artifactId>
+            <version>1.0-DEV</version>
+        </dependency>
+
+        <!-- dependency on packaging plugin to force download -->
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-packaging-plugin</artifactId>
+            <type>plugin</type>
+            <version>0.1</version>
+        </dependency>
+
+        <!-- dependency on the bootstrap gbean deployer so I can deploy myself-->
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-gbean-deployer</artifactId>
+            <type>car</type>
+            <version>0.1</version>
+        </dependency>
+    </dependencies>
+</project>
+

Propchange: geronimo/trunk/configs/geronimo-gbean-deployer/project.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/configs/geronimo-gbean-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/geronimo-gbean-deployer/src/plan/plan.xml?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/configs/geronimo-gbean-deployer/src/plan/plan.xml (added)
+++ geronimo/trunk/configs/geronimo-gbean-deployer/src/plan/plan.xml Sun Mar 20 23:25:45 2005
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+
+<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment"
+    configId="${pom.groupId}/cars/${pom.artifactId}-${pom.currentVersion}.car"
+    domain="geronimo.maven"
+    server="geronimo"
+    >
+
+    <dependency>
+        <uri>geronimo/jars/geronimo-deployment-${geronimo_version}.jar</uri>
+    </dependency>
+    <dependency>
+        <uri>geronimo/jars/geronimo-j2ee-${geronimo_version}.jar</uri>
+    </dependency>
+    <dependency>
+        <uri>geronimo/jars/geronimo-service-builder-${geronimo_version}.jar</uri>
+    </dependency>
+    <dependency>
+        <uri>xmlbeans/jars/xbean-apache-1.0-DEV.jar</uri>
+    </dependency>
+
+    <!-- Deployer used to process modules and plans -->
+    <gbean gbeanName="geronimo.maven:name=Deployer,j2eeType=Deployer,J2EEModule=${pom.groupId}/cars/${pom.artifactId}-${pom.currentVersion}.car" class="org.apache.geronimo.deployment.Deployer">
+        <reference name="Store"><gbean-name>geronimo.maven:name=MavenConfigStore</gbean-name></reference>
+        <reference name="Builders"><name>*</name></reference>
+    </gbean>
+
+    <!-- Builder for handling plans defining Geronimo configurations -->
+    <gbean name="ServiceBuilder" class="org.apache.geronimo.deployment.service.ServiceConfigBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
+        <reference name="Repository"><gbean-name>geronimo.maven:name=Repository</gbean-name></reference>
+        <reference name="XmlAttributeBuilders"><name>*</name></reference>
+    </gbean>
+</configuration>

Propchange: geronimo/trunk/configs/geronimo-gbean-deployer/src/plan/plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Mar 20 23:25:45 2005
@@ -0,0 +1,6 @@
+*.iml
+.project
+.classpath
+maven.log
+junit*.properties
+target

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/LICENSE.txt
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/LICENSE.txt?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/LICENSE.txt (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/LICENSE.txt Sun Mar 20 23:25:45 2005
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/NOTICE.txt
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/NOTICE.txt?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/NOTICE.txt (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/NOTICE.txt Sun Mar 20 23:25:45 2005
@@ -0,0 +1,3 @@
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/NOTICE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/maven.xml?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/maven.xml (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/maven.xml Sun Mar 20 23:25:45 2005
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+
+
+<!-- $Rev$ $Date$ -->
+
+<project default="plugin:install">
+    <goal name="default" prereqs="plugin:install"/>
+</project>

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/maven.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly Sun Mar 20 23:25:45 2005
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project
+    xmlns:artifact="artifact"
+    xmlns:ant="jelly:ant"
+    xmlns:velocity="jelly:velocity"
+    xmlns:define="jelly:define"
+    xmlns:package="geronimo:packaging"
+    >
+    <define:taglib uri="geronimo:packaging">
+        <define:jellybean name="package" className="org.apache.geronimo.plugin.packaging.PackageBuilder" method="execute"/>
+        <define:jellybean name="jmxDistribute" className="org.apache.geronimo.plugin.packaging.JMXDistributor" method="execute"/>
+    </define:taglib>
+
+    <goal name="geronimo" description="Package a Geronimo Configuration" prereqs="geronimo:package"/>
+
+    <goal name="geronimo:prepare-plan" description="Prepare a plan by processing with velocity">
+        <ant:mkdir dir="${geronimo.packaging.buildDir}"/>
+        <velocity:merge basedir="${geronimo.packaging.srcDir}" template="${geronimo.packaging.planFile}" name="${geronimo.packaging.buildFile}"/>
+    </goal>
+
+    <goal name="geronimo:package" prereqs="geronimo:prepare-plan" description="Package a Geronimo Configuration">
+        <package:package
+            repository="${geronimo.packaging.repository}"
+            deploymentConfig="${geronimo.packaging.deploymentConfig}"
+            deployerName="${geronimo.packaging.deployerName}"
+            planFile="${geronimo.packaging.buildFile}"
+            moduleFile="${geronimo.packaging.moduleFile}"
+            packageFile="${maven.build.dir}/${maven.final.name}.car"
+            mainClass="${geronimo.packaging.mainClass}"
+            classPath="${geronimo.packaging.classPath}"
+            endorsedDirs="${geronimo.packaging.endorsedDirs}"
+            />
+    </goal>
+
+    <goal name="geronimo:install" prereqs="geronimo:package" description="Install the package in the local repository">
+        <artifact:install artifact="${maven.build.dir}/${maven.final.name}.car" type="car" project="${pom}"/>
+    </goal>
+
+    <goal name="geronimo:distribute" prereqs="geronimo:package" description="Distribute the package to a server">
+        <package:jmxDistribute
+            user="${geronimo.packaging.user}"
+            password="${geronimo.packaging.password}"
+            url="${geronimo.packaging.url}"
+            storeName="${geronimo.packaging.storeName}"
+            artifact="${maven.build.dir}/${maven.final.name}.car"
+            />
+    </goal>
+</project>

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.jelly
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties Sun Mar 20 23:25:45 2005
@@ -0,0 +1,37 @@
+##
+##
+##   Copyright 2005 The Apache Software Foundation
+##
+##   Licensed 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.
+##
+
+##
+## $Rev$ $Date$
+##
+
+geronimo.packaging.srcDir=${basedir}/src/plan
+geronimo.packaging.planFile=plan.xml
+geronimo.packaging.buildDir=${maven.build.dir}/plan
+geronimo.packaging.buildFile=${geronimo.packaging.buildDir}/${geronimo.packaging.planFile}
+
+geronimo.packaging.repository=${maven.repo.local}
+geronimo.packaging.deploymentConfig=org/apache/geronimo/J2EEDeployer
+geronimo.packaging.deployerName=*:name=Deployer,j2eeType=Deployer,J2EEModule=${geronimo.packaging.deploymentConfig},*
+
+geronimo.packaging.user=system
+geronimo.packaging.password=manager
+geronimo.packaging.hostname=localhost
+geronimo.packaging.storeName=*:j2eeType=ConfigurationStore,*
+geronimo.packaging.protocol=rmi://${geronimo.packaging.hostname}/jndi/rmi
+geronimo.packaging.sap=/JMXConnector
+geronimo.packaging.url=service:jmx:${geronimo.packaging.protocol}:${geronimo.packaging.sap}

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml Sun Mar 20 23:25:45 2005
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+
+<!-- $Rev$ $Date$ -->
+<project>
+    <pomVersion>3</pomVersion>
+    <groupId>geronimo</groupId>
+    <id>geronimo-packaging-plugin</id>
+    <name>Geronimo Packaging Plugin</name>
+    <currentVersion>0.1</currentVersion>
+
+    <dependencies>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cglib</groupId>
+            <artifactId>cglib-full</artifactId>
+            <version>2.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j</artifactId>
+            <version>3.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j-remote</artifactId>
+            <version>3.0.1</version>
+        </dependency>
+
+        <!-- dependencies for velocity pre-processing -->
+        <dependency>
+            <groupId>commons-jelly</groupId>
+            <artifactId>commons-jelly-tags-velocity</artifactId>
+            <version>1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.4</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <sourceDirectory>src/java</sourceDirectory>
+
+        <resources>
+            <resource>
+                <directory></directory>
+                <includes>
+                    <include>plugin.jelly</include>
+                    <include>plugin.properties</include>
+                    <include>project.xml</include>
+                    <include>NOTICE.txt</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+</project>
+

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/project.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/AbstractDistributor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/AbstractDistributor.java?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/AbstractDistributor.java (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/AbstractDistributor.java Sun Mar 20 23:25:45 2005
@@ -0,0 +1,108 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.plugin.packaging;
+
+import java.io.File;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+/**
+ * Base class for Distributors defining common attributes.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class AbstractDistributor {
+    private String user;
+    private String password;
+    private String url;
+    private File artifact;
+    protected ObjectName storeName;
+
+    public String getUser() {
+        return user;
+    }
+
+    /**
+     * Set the username used to connect to the server.
+     *
+     * @param user the username
+     */
+    public void setUser(String user) {
+        this.user = user;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    /**
+     * Set the password used to connect to the server.
+     *
+     * @param password the password
+     */
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    /**
+     * Set the URL of the server.
+     *
+     * @param url the URL of the server
+     */
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public File getArtifact() {
+        return artifact;
+    }
+
+    /**
+     * Set the artifact to distribute.
+     *
+     * @param artifact the artifact to distribute
+     */
+    public void setArtifact(File artifact) {
+        this.artifact = artifact;
+    }
+
+    public String getStoreName() {
+        return storeName.toString();
+    }
+
+    /**
+     * Set the name of the ConfigurationStore in the server that the artifact
+     * should be installed in. This allows for server's that have multiple
+     * stores, although typical installation may only have one.
+     *
+     * @param storeName the name of the ConfigurationStore to distribute to
+     */
+    public void setStoreName(String storeName) {
+        try {
+            this.storeName = new ObjectName(storeName);
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("Invalid storeName: " + storeName, e);
+        }
+    }
+
+    public abstract void execute() throws Exception;
+}

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/AbstractDistributor.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/JMXDistributor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/JMXDistributor.java?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/JMXDistributor.java (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/JMXDistributor.java Sun Mar 20 23:25:45 2005
@@ -0,0 +1,73 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.plugin.packaging;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.apache.geronimo.common.DeploymentException;
+
+/**
+ * A Distributor that will distribute packages to a server using JMX remoting.
+ * Currently this is limited to a server on the same machine (because the
+ * location of the artifact is passed using a file: URL).
+ *
+ * @version $Rev$ $Date$
+ */
+public class JMXDistributor extends AbstractDistributor {
+    public void execute() throws Exception {
+        if (!getArtifact().canRead()) {
+            throw new DeploymentException("Unable to read artifact " + getArtifact());
+        }
+
+        Map environment = new HashMap();
+        environment.put(JMXConnector.CREDENTIALS, new String[]{getUser(), getPassword()});
+
+        JMXServiceURL serviceURL = new JMXServiceURL(getUrl());
+        JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, environment);
+        try {
+            MBeanServerConnection mbServer = jmxConnector.getMBeanServerConnection();
+
+            ObjectName configStore = locateConfigStore(mbServer, storeName);
+            mbServer.invoke(configStore, "install", new Object[]{getArtifact().toURL()}, new String[]{URL.class.getName()});
+            System.out.println("Distributed " + getArtifact() + " to " + getUrl());
+        } finally {
+            jmxConnector.close();
+        }
+    }
+
+    private ObjectName locateConfigStore(MBeanServerConnection mbServer, ObjectName storeName) throws Exception {
+        Set set = mbServer.queryNames(storeName, null);
+        Iterator i = set.iterator();
+        if (!i.hasNext()) {
+            throw new DeploymentException("No ConfigurationStore found matching " + storeName);
+        }
+        ObjectName configStore = (ObjectName) i.next();
+        if (i.hasNext()) {
+            throw new DeploymentException("Multiple ConfigurationStores found matching " + storeName);
+        }
+        return configStore;
+    }
+}

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/JMXDistributor.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java Sun Mar 20 23:25:45 2005
@@ -0,0 +1,141 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.plugin.packaging;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.repository.Repository;
+
+/**
+ * Implementation of ConfigurationStore that loads Configurations from a repository.
+ * This implementation is read-only on the assumption that a separate maven task will
+ * handle installation of a built package into the repository.
+ *
+ * @version $Rev$ $Date$
+ */
+public class MavenConfigStore implements ConfigurationStore {
+    private final ObjectName objectName;
+    private final Repository repository;
+
+    public MavenConfigStore(String objectName, Repository repository) throws MalformedObjectNameException {
+        this.objectName = new ObjectName(objectName);
+        this.repository = repository;
+    }
+
+    public String getObjectName() {
+        return objectName.toString();
+    }
+
+    public GBeanData getConfiguration(URI id) throws NoSuchConfigException, IOException, InvalidConfigException {
+        if (!repository.hasURI(id)) {
+            throw new NoSuchConfigException("Configuration not found: " + id);
+        }
+
+        URL stateURL = new URL(getBaseURL(id), "META-INF/config.ser");
+        InputStream jis = stateURL.openStream();
+        try {
+            ObjectInputStream ois = new ObjectInputStream(jis);
+            GBeanData config = new GBeanData();
+            config.readExternal(ois);
+            config.setReferencePattern("ConfigurationStore", objectName);
+            return config;
+        } catch (ClassNotFoundException e) {
+            throw new InvalidConfigException("Unable to load class from config: " + id, e);
+        } finally {
+            jis.close();
+        }
+    }
+
+    public boolean containsConfiguration(URI configID) {
+        return repository.hasURI(configID);
+    }
+
+    public File createNewConfigurationDir() {
+        try {
+            File tmpFile = File.createTempFile("package", ".tmpdir");
+            tmpFile.delete();
+            tmpFile.mkdir();
+            if (!tmpFile.isDirectory()) {
+                return null;
+            }
+            return tmpFile;
+        } catch (IOException e) {
+            // doh why can't I throw this?
+            return null;
+        }
+    }
+
+    public URL getBaseURL(URI id) throws NoSuchConfigException {
+        try {
+            return new URL("jar:" + repository.getURL(id).toString() + "!/");
+        } catch (MalformedURLException e) {
+            throw new AssertionError();
+        }
+    }
+
+    public URI install(URL source) throws IOException, InvalidConfigException {
+        throw new UnsupportedOperationException();
+    }
+
+    public URI install(File source) throws IOException, InvalidConfigException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void uninstall(URI configID) throws NoSuchConfigException, IOException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void updateConfiguration(Configuration configuration) throws NoSuchConfigException, Exception {
+        throw new UnsupportedOperationException();
+    }
+
+    public List listConfiguations() {
+        throw new UnsupportedOperationException();
+    }
+
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+    static {
+        GBeanInfoBuilder builder = new GBeanInfoBuilder(MavenConfigStore.class);
+        builder.addInterface(ConfigurationStore.class);
+        builder.addAttribute("objectName", String.class, false);
+        builder.addReference("Repository", Repository.class);
+        builder.setConstructor(new String[]{"objectName", "Repository"});
+        GBEAN_INFO = builder.getBeanInfo();
+    }
+}

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java Sun Mar 20 23:25:45 2005
@@ -0,0 +1,73 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.plugin.packaging;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.repository.Repository;
+
+/**
+ * Implementation of Repository that maps to the local Maven repository.
+ *
+ * @version $Rev$ $Date$
+ */
+public class MavenRepository implements Repository {
+    private final URI root;
+
+    public MavenRepository(File root) {
+        this.root = root.toURI();
+    }
+
+    public boolean hasURI(URI uri) {
+        uri = root.resolve(uri);
+        if ("file".equals(uri.getScheme())) {
+            return new File(uri).canRead();
+        } else {
+            try {
+                uri.toURL().openStream().close();
+                return true;
+            } catch (IOException e) {
+                return false;
+            }
+        }
+    }
+
+    public URL getURL(URI uri) throws MalformedURLException {
+        uri = root.resolve(uri);
+        return uri.toURL();
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+    static {
+        GBeanInfoBuilder builder = new GBeanInfoBuilder(MavenRepository.class);
+        builder.addInterface(Repository.class);
+        builder.addAttribute("root", File.class, true);
+        builder.setConstructor(new String[]{"root"});
+        GBEAN_INFO = builder.getBeanInfo();
+    }
+}

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev

Added: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java?view=auto&rev=158417
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java (added)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java Sun Mar 20 23:25:45 2005
@@ -0,0 +1,266 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.plugin.packaging;
+
+import java.io.File;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+
+/**
+ * JellyBean that builds a Geronimo Configuration using the local Mavem
+ * infrastructure.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PackageBuilder {
+    private static final String KERNEL_NAME = "geronimo.maven";
+    /**
+     * The name of the GBean that will load dependencies from the Maven repository.
+     */
+    private static final ObjectName REPOSITORY_NAME;
+
+    /**
+     * The name of the GBean that will load Configurations from the Maven repository.
+     */
+    private static final ObjectName CONFIGSTORE_NAME;
+
+    private static final String[] ARG_TYPES = {
+        File.class.getName(),
+        File.class.getName(),
+        File.class.getName(),
+        Boolean.TYPE.getName(),
+        String.class.getName(),
+        String.class.getName(),
+        String.class.getName(),
+    };
+
+    static {
+        try {
+            REPOSITORY_NAME = new ObjectName(KERNEL_NAME + ":name=Repository");
+            CONFIGSTORE_NAME = new ObjectName(KERNEL_NAME + ":name=MavenConfigStore,j2eeType=ConfigurationStore");
+        } catch (MalformedObjectNameException e) {
+            throw new ExceptionInInitializerError(e.getMessage());
+        }
+    }
+
+    private File repository;
+    private URI deploymentConfig;
+    private ObjectName deployerName;
+
+    private File planFile;
+    private File moduleFile;
+    private File packageFile;
+    private String mainClass;
+    private String classPath;
+    private String endorsedDirs;
+
+    public File getRepository() {
+        return repository;
+    }
+
+    /**
+     * Set the location of the Maven repository; typically ${maven.repo.local}
+     *
+     * @param repository the location of the Maven repository
+     */
+    public void setRepository(File repository) {
+        this.repository = repository;
+    }
+
+    public String getDeploymentConfig() {
+        return deploymentConfig.toString();
+    }
+
+    /**
+     * Set the id of the Configuration to use to perform the packaging.
+     *
+     * @param deploymentConfig the id of the Configuration performing the deployment
+     */
+    public void setDeploymentConfig(String deploymentConfig) {
+        this.deploymentConfig = URI.create(deploymentConfig);
+    }
+
+    public String getDeployerName() {
+        return deployerName.toString();
+    }
+
+    /**
+     * Set the name of the GBean that is the Deployer.
+     *
+     * @param deployerName the name of the Deployer GBean
+     */
+    public void setDeployerName(String deployerName) {
+        try {
+            this.deployerName = new ObjectName(deployerName);
+        } catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("deployerName is not a valid ObjectName: " + deployerName);
+        }
+    }
+
+    public File getPlanFile() {
+        return planFile;
+    }
+
+    /**
+     * Set the File that is the deployment plan.
+     *
+     * @param planFile the deployment plan
+     */
+    public void setPlanFile(File planFile) {
+        this.planFile = planFile;
+    }
+
+    public File getModuleFile() {
+        return moduleFile;
+    }
+
+    /**
+     * Set the File that is the module being deployed.
+     *
+     * @param moduleFile the module to deploy
+     */
+    public void setModuleFile(File moduleFile) {
+        this.moduleFile = moduleFile;
+    }
+
+    public File getPackageFile() {
+        return packageFile;
+    }
+
+    /**
+     * Set the File where the Configuration will be stored; normally the artifact being produced.
+     *
+     * @param packageFile the package file to produce
+     */
+    public void setPackageFile(File packageFile) {
+        this.packageFile = packageFile;
+    }
+
+    public String getMainClass() {
+        return mainClass;
+    }
+
+    /**
+     * Set the name of the class containing the main method for a executable configuration.
+     *
+     * @param mainClass
+     */
+    public void setMainClass(String mainClass) {
+        this.mainClass = mainClass;
+    }
+
+    public String getClassPath() {
+        return classPath;
+    }
+
+    public void setClassPath(String classPath) {
+        this.classPath = classPath;
+    }
+
+    public String getEndorsedDirs() {
+        return endorsedDirs;
+    }
+
+    public void setEndorsedDirs(String endorsedDirs) {
+        this.endorsedDirs = endorsedDirs;
+    }
+
+    public void execute() throws Exception {
+        Kernel kernel = createKernel();
+
+        // start the Configuration we're going to use for this deployment
+        ConfigurationManager configMgr = kernel.getConfigurationManager();
+        if (!configMgr.isLoaded(deploymentConfig)) {
+            List configs = configMgr.loadRecursive(deploymentConfig);
+            for (int i = 0; i < configs.size(); i++) {
+                ObjectName configName = (ObjectName) configs.get(i);
+                kernel.startRecursiveGBean(configName);
+            }
+        }
+
+        ObjectName deployer = locateDeployer(kernel);
+        invokeDeployer(kernel, deployer);
+        System.out.println("Generated package " + packageFile);
+    }
+
+    /**
+     * Create a Geronimo Kernel to contain the deployment configurations.
+     */
+    private Kernel createKernel() throws Exception {
+        Kernel kernel = Kernel.getKernel(KERNEL_NAME);
+        if (kernel != null) {
+            return kernel;
+        }
+
+        kernel = new Kernel(KERNEL_NAME);
+        kernel.boot();
+
+        bootDeployerSystem(kernel);
+
+        return kernel;
+    }
+
+    /**
+     * Boot the in-Maven deployment system.
+     * This contains just Repository and ConfigurationStore GBeans that map to
+     * the local maven installation.
+     */
+    private void bootDeployerSystem(Kernel kernel) throws Exception {
+        ClassLoader cl = PackageBuilder.class.getClassLoader();
+        GBeanData repoGBean = new GBeanData(REPOSITORY_NAME, MavenRepository.GBEAN_INFO);
+        repoGBean.setAttribute("root", repository);
+
+        GBeanData storeGBean = new GBeanData(CONFIGSTORE_NAME, MavenConfigStore.GBEAN_INFO);
+        storeGBean.setReferencePattern("Repository", REPOSITORY_NAME);
+
+        kernel.loadGBean(repoGBean, cl);
+        kernel.startGBean(REPOSITORY_NAME);
+        kernel.loadGBean(storeGBean, cl);
+        kernel.startGBean(CONFIGSTORE_NAME);
+    }
+
+    /**
+     * Locate a Deployer GBean matching the deployerName pattern.
+     *
+     * @param kernel the kernel to search.
+     * @return the ObjectName of the Deployer GBean
+     * @throws IllegalStateException if there is not exactly one GBean matching the deployerName pattern
+     */
+    private ObjectName locateDeployer(Kernel kernel) {
+        Iterator i = kernel.listGBeans(deployerName).iterator();
+        if (!i.hasNext()) {
+            throw new IllegalStateException("No deployer found matching deployerName: " + deployerName);
+        }
+        ObjectName deployer = (ObjectName) i.next();
+        if (i.hasNext()) {
+            throw new IllegalStateException("Multiple deployers found matching deployerName: " + deployerName);
+        }
+        return deployer;
+    }
+
+    private List invokeDeployer(Kernel kernel, ObjectName deployer) throws Exception {
+        Object[] args = {planFile, moduleFile, packageFile, Boolean.FALSE, mainClass, classPath, endorsedDirs};
+        return (List) kernel.invoke(deployer, "deploy", args, ARG_TYPES);
+    }
+}

Propchange: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Rev



Mime
View raw message