diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 64812538d..c649ae7a9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -233,6 +233,7 @@ Mariusz Nowostawski Mark A. Ziesemer Mark DeLaFranier Mark Hecker +Mark Niggemann Mark R. Diggory Mark Salter Markus Kahl diff --git a/WHATSNEW b/WHATSNEW index ba2213e59..b3a7a4ece 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -39,6 +39,9 @@ Other changes: override the current time/date used by . Bugzilla Report 61079 + * added Orion support to ejbjar + Github Pull Request #33 + Changes from Ant 1.10.0 TO Ant 1.10.1 ===================================== diff --git a/contributors.xml b/contributors.xml index ade30f9f9..c73478cec 100644 --- a/contributors.xml +++ b/contributors.xml @@ -959,6 +959,10 @@ R. Diggory + + Mark + Niggemann + Mark A. diff --git a/manual/Tasks/ejb.html b/manual/Tasks/ejb.html index aa140e703..4911e1407 100644 --- a/manual/Tasks/ejb.html +++ b/manual/Tasks/ejb.html @@ -61,6 +61,8 @@ In general these tasks are specific to the particular vendor's EJB Server.

Application Server 6.0
  • JBoss 2.1 and above EJB servers
  • +
  • + Orion Application Server 2.0 since 1.10.2
  • Weblogic 4.5.1 through to 7.0 EJB servers
  • JOnAS @@ -81,14 +83,15 @@ In general these tasks are specific to the particular vendor's EJB Server.

    TaskApplication Servers blgenclientBorland Application Server 4.5 and 5.x iplanet-ejbciPlanet Application Server 6.0 - ejbjarNested Elements + ejbjarNested Elements borlandBorland Application Server 4.5 and 5.x iPlanetiPlanet Application Server 6.0 jbossJBoss jonasJOnAS 2.4.x and 2.5 weblogicWeblogic 5.1 to 7.0 websphereIBM WebSphere 4.0 - + orionIronFlare(Oracle) Orion Application Server 2.0.6 +
    @@ -562,6 +565,7 @@ include:

  • IBM WebSphere 4.0
  • TOPLink for WebLogic 2.5.1-enabled entity beans
  • JOnAS 2.4.x and 2.5 Open Source EJB server
  • +
  • IronFlare Orion Application Server 2.0
  • @@ -1770,7 +1774,42 @@ descriptors to use the naming standard. This will create only one ejb jar file - +

    Orion element

    + +

    The orion element searches for the Orion Application Server specific deployment descriptors and adds them +to the final ejb jar file. Orion has one deployment descriptor: +

    +
    + + + + + + + + + + + +
    AttributeDescriptionRequired
    destdirThe base directory into which the generated + jar files are deposited. Jar files are deposited in + directories corresponding to their location within the + descriptordir namespace. Yes
    + +

    Example

    +
    +      <ejbjar srcdir="${build.classes}"
    +              descriptordir="${descriptor.dir}"
    +              basejarname="TheEJBJar"
    +              flatdestdir="true"
    +              dependency="super"
    +              genericjarsuffix=".jar">
    +        <include name="**/*-ejb-jar.xml"/>
    +        <orion destdir="${deploymentjars.dir}"\>
    +      </ejbjar>
    +
    diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java index f582091fc..948da53be 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java @@ -223,6 +223,19 @@ public class EjbJar extends MatchingTask { deploymentTools.add(deploymentTool); } + /** + * Create a orion nested element used to configure a + * deployment tool for Orion server. + * + * @return the deployment tool instance to be configured. + * @since Ant 1.10.2 + */ + public OrionDeploymentTool createOrion() { + OrionDeploymentTool tool = new OrionDeploymentTool(); + addDeploymentTool(tool); + return tool; + } + /** * Adds a deployment tool for Weblogic server. * diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/OrionDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/OrionDeploymentTool.java new file mode 100644 index 000000000..38e2ae3cc --- /dev/null +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/OrionDeploymentTool.java @@ -0,0 +1,66 @@ +/* + * 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.tools.ant.taskdefs.optional.ejb; + +import java.io.File; +import java.util.Hashtable; +import org.apache.tools.ant.Project; + +/** + * The deployment tool to add the orion specific deployment descriptor to the + * ejb jar file. Orion only requires one additional file orion-ejb-jar.xml + * and does not require any additional compilation. + * + * @since Ant 1.10.2 + * @see EjbJar#createOrion + */ + +public class OrionDeploymentTool extends GenericDeploymentTool { + + protected static final String ORION_DD = "orion-ejb-jar.xml"; + + + /** Instance variable that stores the suffix for the jboss jarfile. */ + private String jarSuffix = ".jar"; + + /** + * Add any vendor specific files which should be included in the + * EJB Jar. + */ + protected void addVendorFiles(Hashtable ejbFiles, String baseName) { + String ddPrefix = (usingBaseJarName() ? "" : baseName ); + File orionDD = new File(getConfig().descriptorDir, ddPrefix + ORION_DD); + + if (orionDD.exists()) { + ejbFiles.put(META_DIR + ORION_DD, orionDD); + } else { + log("Unable to locate Orion deployment descriptor. It was expected to be in " + orionDD.getPath(), Project.MSG_WARN); + return; + } + + } + + /** + * Get the vendor specific name of the Jar that will be output. The modification date + * of this jar will be checked against the dependent bean classes. + */ + File getVendorOutputJarFile(String baseName) { + return new File(getDestDir(), baseName + jarSuffix); + } +}