[jboss-cvs] JBossAS SVN: r64275 - in projects/microcontainer/trunk: deployers-client-spi/src/main/org/jboss/deployers/client/spi and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jul 25 13:22:17 EDT 2007
Author: scott.stark at jboss.org
Date: 2007-07-25 13:22:17 -0400 (Wed, 25 Jul 2007)
New Revision: 64275
Added:
projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/ConnMetaData.java
projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/DSMetaData.java
projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/MCFDeployer.java
projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/SecMetaData.java
projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedComponentCreator.java
projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedDeploymentCreator.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ComponentType.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/DeploymentTemplateInfo.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedComponent.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedDeployment.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponent.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponentRef.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ViewUse.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/BaseManagedObject.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedComponentImpl.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedDeploymentImpl.java
Removed:
projects/microcontainer/trunk/container/src/main/org/jboss/annotation/management/
Modified:
projects/microcontainer/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeployerClient.java
projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java
projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementProperty.java
Log:
JBMICROCONT-181, expand the ManagedObject notion to ManagedDeployments
Modified: projects/microcontainer/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeployerClient.java
===================================================================
--- projects/microcontainer/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeployerClient.java 2007-07-25 16:47:51 UTC (rev 64274)
+++ projects/microcontainer/trunk/deployers-client-spi/src/main/org/jboss/deployers/client/spi/DeployerClient.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -26,6 +26,7 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.DeploymentState;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedObject;
import org.jboss.util.graph.Graph;
@@ -158,4 +159,6 @@
* @throws DeploymentException
*/
Graph<Map<String, ManagedObject>> getDeepManagedObjects(String name) throws DeploymentException;
+
+ ManagedDeployment getManagedDeployment(String name) throws DeploymentException;
}
Modified: projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java 2007-07-25 16:47:51 UTC (rev 64274)
+++ projects/microcontainer/trunk/deployers-impl/src/main/org/jboss/deployers/plugins/main/MainDeployerImpl.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -40,6 +40,7 @@
import org.jboss.deployers.structure.spi.StructuralDeployers;
import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedObject;
import org.jboss.util.graph.Graph;
import org.jboss.util.graph.Vertex;
@@ -406,6 +407,15 @@
return context.getState();
}
+ /**
+ *
+ */
+ public ManagedDeployment getManagedDeployment(String name) throws DeploymentException
+ {
+ ManagedDeployment md = null;
+ return md;
+ }
+
public Map<String, ManagedObject> getManagedObjects(String name) throws DeploymentException
{
DeploymentContext context = getDeploymentContext(name);
Added: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/ConnMetaData.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/ConnMetaData.java (rev 0)
+++ projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/ConnMetaData.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.deployer.support;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
+/**
+ * Test connection factory like metadata.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ConnMetaData implements Serializable
+{
+ private static final long serialVersionUID = 1;
+ private int minSize;
+ private int maxSize;
+ private String jndiName;
+ private String username;
+ private char[] password;
+ private Properties connProperties;
+ private SecMetaData securityMetaData;
+
+ @ManagementProperty(name="jndi-name")
+ public String getJndiName()
+ {
+ return jndiName;
+ }
+ public void setJndiName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+ @ManagementProperty(name="max-size")
+ public int getMaxSize()
+ {
+ return maxSize;
+ }
+ public void setMaxSize(int maxSize)
+ {
+ this.maxSize = maxSize;
+ }
+ @ManagementProperty(name="min-size")
+ public int getMinSize()
+ {
+ return minSize;
+ }
+ public void setMinSize(int minSize)
+ {
+ this.minSize = minSize;
+ }
+ @ManagementProperty
+ public char[] getPassword()
+ {
+ return password;
+ }
+ public void setPassword(char[] password)
+ {
+ this.password = password;
+ }
+ @ManagementProperty
+ public String getUsername()
+ {
+ return username;
+ }
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+ @ManagementProperty(name="connection-properties")
+ public Properties getConnProperties()
+ {
+ return connProperties;
+ }
+ public void setConnProperties(Properties connProperties)
+ {
+ this.connProperties = connProperties;
+ }
+
+ @ManagementComponent(name="security-domain")
+ public SecMetaData getSecurityMetaData()
+ {
+ return securityMetaData;
+ }
+ public void setSecurityMetaData(SecMetaData securityMetaData)
+ {
+ this.securityMetaData = securityMetaData;
+ }
+}
Property changes on: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/ConnMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/DSMetaData.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/DSMetaData.java (rev 0)
+++ projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/DSMetaData.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.deployer.support;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
+/**
+ * Test datasource deployment like metadata
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class DSMetaData implements Serializable
+{
+ private static final long serialVersionUID = 1;
+ private String diplayName;
+ private List<ConnMetaData> deployments = new ArrayList<ConnMetaData>();
+
+ @ManagementProperty(name="display-name", use={})
+ public String getDiplayName()
+ {
+ return diplayName;
+ }
+
+ public void setDiplayName(String diplayName)
+ {
+ this.diplayName = diplayName;
+ }
+
+ public void addManagedConnectionFactoryDeployment(ConnMetaData deployment)
+ {
+ this.deployments.add(deployment);
+ }
+
+ @ManagementComponent
+ public List<ConnMetaData> getDeployments()
+ {
+ return Collections.unmodifiableList(deployments);
+ }
+
+}
Property changes on: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/DSMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/MCFDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/MCFDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/MCFDeployer.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,31 @@
+package org.jboss.test.deployers.deployer.support;
+
+import java.util.Set;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.spi.deployer.managed.ManagedDeploymentCreator;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.managed.api.ManagedDeployment;
+
+public class MCFDeployer
+ extends AbstractSimpleRealDeployer<DSMetaData>
+ implements ManagedDeploymentCreator<DSMetaData>
+
+{
+ public MCFDeployer(Class<DSMetaData> input)
+ {
+ super(input);
+ }
+
+ @Override
+ public void deploy(DeploymentUnit unit, DSMetaData deployment)
+ throws DeploymentException
+ {
+ }
+
+ public void build(DeploymentUnit unit, ManagedDeployment md, Set<? extends DSMetaData> metaData)
+ {
+ }
+
+}
Property changes on: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/MCFDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/SecMetaData.java
===================================================================
--- projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/SecMetaData.java (rev 0)
+++ projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/SecMetaData.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,47 @@
+package org.jboss.test.deployers.deployer.support;
+
+import java.io.Serializable;
+
+import org.jboss.managed.api.annotation.ManagementComponentRef;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
+/**
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class SecMetaData implements Serializable
+{
+ private static final long serialVersionUID = 1;
+
+ public enum SecurityDeploymentType {NONE, APPLICATION, DOMAIN, DOMAIN_AND_APPLICATION};
+
+ private String domain;
+ private SecurityDeploymentType type;
+
+ /**
+ * The domain value refers to a security domain component if type is either
+ * DOMAIN, DOMAIN_AND_APPLICATION
+ * @return
+ */
+ @ManagementProperty(name="domain-name")
+ @ManagementComponentRef
+ public String getDomain()
+ {
+ return domain;
+ }
+ public void setDomain(String domain)
+ {
+ this.domain = domain;
+ }
+ @ManagementProperty(name="security-criteria")
+ public SecurityDeploymentType getType()
+ {
+ return type;
+ }
+ public void setType(SecurityDeploymentType type)
+ {
+ this.type = type;
+ }
+
+}
Property changes on: projects/microcontainer/trunk/deployers-impl/src/tests/org/jboss/test/deployers/deployer/support/SecMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedComponentCreator.java
===================================================================
--- projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedComponentCreator.java (rev 0)
+++ projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedComponentCreator.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2007, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.deployers.spi.deployer.managed;
+
+import java.util.Set;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.managed.api.ManagedDeployment;
+
+/**
+ * A plugin interface for building up the ManagedComponents of
+ * a ManagedDeployment.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface ManagedComponentCreator<T>
+{
+ /**
+ * Callout to create the ManagedComponents that correspond to
+ * the given metdata.
+ *
+ * @param unit - the deployment unit to process
+ * @param md - the unit ManagedDeployment
+ * @param metaData - the unit metadata of type T for which the
+ * ManagedComponents should be created.
+ */
+ public void build(DeploymentUnit unit, ManagedDeployment md,
+ Set<? extends T> metaData);
+}
Property changes on: projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedComponentCreator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedDeploymentCreator.java
===================================================================
--- projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedDeploymentCreator.java (rev 0)
+++ projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedDeploymentCreator.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2007, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.deployers.spi.deployer.managed;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.managed.api.ManagedDeployment;
+
+/**
+ * A plugin interface for building up a ManagedDeployment.
+ *
+ * TODO: Generally an implementation would make use of registered
+ * ManagedComponentCreator instances. Should the ManagedComponentCreator
+ * registry be part of this interface?
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface ManagedDeploymentCreator
+{
+ /**
+ * Build up the deployment management view.
+ * @param unit - the deployment unit to process
+ * @param md - the unit ManagedDeployment
+ */
+ public void build(DeploymentUnit unit, ManagedDeployment md);
+}
Property changes on: projects/microcontainer/trunk/deployers-spi/src/main/org/jboss/deployers/spi/deployer/managed/ManagedDeploymentCreator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ComponentType.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ComponentType.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ComponentType.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.api;
+
+import java.io.Serializable;
+
+/**
+ * A simple type/subtype key for a ManagedComponent. Example
+ * type/subtypes include: DataSource/{XA,LocalTx,NoTX},
+ * JMSDestination/{Queue,Topic},
+ * EJB/{StatelessSession,StatefulSession,Entity,MDB},
+ * MBean/{Standard,XMBean,Dynamic},
+ * ...
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ComponentType
+ implements Serializable
+{
+ private static final long serialVersionUID = 1;
+ private String type;
+ private String subtype;
+
+ public ComponentType()
+ {
+
+ }
+ public ComponentType(String type, String subtype)
+ {
+ this.type = type;
+ this.subtype = subtype;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String getSubtype()
+ {
+ return subtype;
+ }
+ public void setSubtype(String subtype)
+ {
+ this.subtype = subtype;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int hashCode = 1;
+ if( type != null )
+ hashCode += type.hashCode();
+ if( subtype != null )
+ hashCode += subtype.hashCode();
+ return hashCode;
+ }
+ @Override
+ public boolean equals(Object obj)
+ {
+ if( this == obj )
+ return true;
+ if( (obj instanceof ComponentType) == false )
+ return false;
+
+ boolean equals = false;
+ final ComponentType other = (ComponentType) obj;
+ // type
+ if( type != null )
+ {
+ equals = type.equals(other.getType());
+ }
+ else
+ {
+ equals = type == other.getType();
+ }
+ // subtype
+ if( equals )
+ {
+ if( subtype != null )
+ {
+ equals = subtype.equals(other.getSubtype());
+ }
+ else
+ {
+ equals = subtype == other.getSubtype();
+ }
+ }
+ return equals;
+ }
+
+ public String toString()
+ {
+ StringBuilder tmp = new StringBuilder("ComponentType");
+ tmp.append('{');
+ tmp.append("type=");
+ tmp.append(type);
+ tmp.append(", subtype=");
+ tmp.append(subtype);
+ tmp.append('}');
+ return tmp.toString();
+ }
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ComponentType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/DeploymentTemplateInfo.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/DeploymentTemplateInfo.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/DeploymentTemplateInfo.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.api;
+
+import java.util.Map;
+
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ * The exportable information for a DeploymentTemplate.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface DeploymentTemplateInfo
+{
+ public String getName();
+ public String getDescription();
+ public Map<String, ManagedProperty> getProperties();
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/DeploymentTemplateInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedComponent.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedComponent.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedComponent.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.api;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ * A runtime component associated with a deployment.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface ManagedComponent
+{
+ /**
+ * The component name, typically only unique within the ManagedDeployment
+ * @return omponent name
+ */
+ public String getName();
+ /**
+ * The component classification as a type/subtype.
+ * @return component type.
+ */
+ public ComponentType getType();
+ /**
+ * Get the managed property names
+ *
+ * @return the property names
+ */
+ public Set<String> getPropertyNames();
+ /**
+ * Get a property
+ *
+ * @param name the name
+ * @return the property
+ */
+ public ManagedProperty getProperty(String name);
+
+ /**
+ * Get the properties
+ *
+ * @return the properties
+ */
+ public Map<String, ManagedProperty> getProperties();
+
+ /**
+ * The deployment the component is associated with.
+ * @return component deployment.
+ */
+ public ManagedDeployment getDeployment();
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedComponent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedDeployment.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedDeployment.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedDeployment.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.api;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ * A collection of ManagedComponent and structural information
+ * about a deployment.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface ManagedDeployment
+{
+ /** The class of deployment */
+ public enum DeploymentPhase {
+ /** A deployment loaded during the server bootstrap phase */
+ BOOTSTRAP,
+ /** An mc/service deployment for a Deployer to be loaded after the BOOTSTRAP phase */
+ DEPLOYER,
+ /** Any deployment content to be loaded after the DEPLOYER phase */
+ APPLICATION
+ };
+
+ /**
+ * Get the full name of the associated DeploymentUnit.
+ * @return full name of the DeploymentUnit
+ */
+ public String getName();
+ /**
+ * Get the simple name (x.ear) for the deployment
+ * @return simple name of the deployment
+ */
+ public String getSimpleName();
+ /**
+ * Get the phase this deployment is associated with
+ * @return the phase
+ */
+ public DeploymentPhase getDeploymentPhase();
+ /**
+ * Add a deployment/module type
+ * @param type
+ * @return true if the type was added, false if it already exists
+ */
+ public boolean addType(String type);
+ /**
+ * Get the deployment/module types.
+ * @return deployment types
+ */
+ public Set<String> getTypes();
+ /**
+ * Get the deployment/module types.
+ * @param types
+ */
+ public void setTypes(Set<String> types);
+
+ /**
+ * Get the managed property names
+ *
+ * @return the property names
+ */
+ public Set<String> getPropertyNames();
+ /**
+ * Get a property
+ *
+ * @param name the name
+ * @return the property
+ */
+ public ManagedProperty getProperty(String name);
+
+ /**
+ * Get the properties
+ *
+ * @return the properties
+ */
+ public Map<String, ManagedProperty> getProperties();
+
+ /**
+ *
+ * @return the parent
+ */
+ public ManagedDeployment getParent();
+
+ public ManagedComponent getComponent(String name);
+
+ /**
+ * Get the ManagedComponents for the deployment module.
+ * @return ManagedComponents for the deployment module.
+ */
+ public Map<String, ManagedComponent> getComponents();
+ /**
+ * Get the nested deployment modules.
+ * @return nested deployment modules.
+ */
+ public List<ManagedDeployment> getChildren();
+
+ /**
+ * Get the DeploymentTemplate names for components
+ * that can be added to this deployment.
+ * @return the template names
+ */
+ public Set<String> getComponentTemplateNames();
+
+ /**
+ * Add a component to this deployment
+ * @param name
+ * @param comp
+ */
+ public void addComponent(String name, ManagedComponent comp);
+ /**
+ *
+ * @param name
+ */
+ public boolean removeComponent(String name);
+
+ /**
+ * Get the DeploymentTemplate names for deployments
+ * that can be added to this deployment.
+ * @return the template names
+ */
+ public Set<String> getDeploymentTemplateNames();
+ /**
+ * Add a deployment
+ * @param deplymentBaseName
+ * @param info
+ * @return the deployment
+ */
+ public ManagedDeployment addModule(String deplymentBaseName, DeploymentTemplateInfo info);
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/ManagedDeployment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponent.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponent.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponent.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.api.annotation;
+
+/**
+ * An annotation that identifies property as metdata identifying
+ * a ManagedComponent
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public @interface ManagementComponent
+{
+ String name() default "";
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponentRef.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponentRef.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponentRef.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.api.annotation;
+
+/**
+ * Indicates a property
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public @interface ManagementComponentRef
+{
+ String name() default "";
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementComponentRef.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementProperty.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementProperty.java 2007-07-25 16:47:51 UTC (rev 64274)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementProperty.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -27,10 +27,13 @@
import java.lang.annotation.Target;
/**
- * ManagementProperty.
+ * ManagementProperty annotation for describing a ManagedProperty
*
+ * TODO: Need more info on meta-type such as constraints, allowed values.
+ *
* @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@@ -38,7 +41,15 @@
{
/** The description */
String description() default ManagementConstants.GENERATED;
-
+
+ /** The external name of the property. If undefined its taken
+ * from the property the annotation is on.
+ */
+ String name() default "";
+
+ /** The internal name of the property as it relates to metadata */
+ String mappedName() default "";
+
/** Whether this property is mandatory */
boolean mandatory() default false;
@@ -47,4 +58,8 @@
/** Whether to ignore this property */
boolean ignored() default false;
+
+ /** The views this property should be used in */
+ ViewUse[] use() default {ViewUse.RUNTIME};
+
}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ManagementProperty.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Copied: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ViewUse.java (from rev 64256, projects/microcontainer/trunk/container/src/main/org/jboss/annotation/management/ViewUse.java)
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ViewUse.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/api/annotation/ViewUse.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.api.annotation;
+
+/**
+ * An enum for the types of management views a {@link ManagedProperty property}
+ * is associated with.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public enum ViewUse
+{
+ /** A read-write property used for creating/updating a config */
+ CONFIGURATION,
+ /** A read-only type of property */
+ RUNTIME,
+ /** A read-only type of property that provides runtime stats */
+ STATISTIC
+}
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/BaseManagedObject.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/BaseManagedObject.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/BaseManagedObject.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.plugins;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class BaseManagedObject implements Serializable
+{
+ private static final long serialVersionUID = 1;
+ private String simpleName;
+ private Map<String, ManagedProperty> properties;
+
+ public BaseManagedObject(String simpleName, Map<String, ManagedProperty> properties)
+ {
+ this.simpleName = simpleName;
+ this.properties = properties;
+ }
+
+ public String getSimpleName()
+ {
+ return simpleName;
+ }
+ public String getName()
+ {
+ return simpleName;
+ }
+
+ /**
+ * Get the managed property names
+ *
+ * @return the property names
+ */
+ public Set<String> getPropertyNames()
+ {
+ return properties.keySet();
+ }
+
+ /**
+ * Get a property
+ *
+ * @param name the name
+ * @return the property
+ */
+ public ManagedProperty getProperty(String name)
+ {
+ ManagedProperty prop = properties.get(name);
+ return prop;
+ }
+
+ /**
+ * Get the properties
+ *
+ * @return the properties
+ */
+ public Map<String, ManagedProperty> getProperties()
+ {
+ return properties;
+ }
+
+ /**
+ * Append the name and props
+ * @param sb the buffer to append the name and props to
+ */
+ protected void toString(StringBuilder sb)
+ {
+ sb.append("simpleName=");
+ sb.append(simpleName);
+ sb.append(", properties=");
+ sb.append(properties);
+ }
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/BaseManagedObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedComponentImpl.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedComponentImpl.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedComponentImpl.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.plugins;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ManagedComponentImpl extends BaseManagedObject
+ implements ManagedComponent, Serializable
+{
+ private static final long serialVersionUID = 1;
+
+ private ManagedDeployment owner;
+ private ComponentType type;
+
+ ManagedComponentImpl(String name, ComponentType type, Map<String, ManagedProperty> properties, ManagedDeployment owner)
+ {
+ super(name, properties);
+ this.type = type;
+ this.owner = owner;
+ }
+
+ public ManagedDeployment getDeployment()
+ {
+ return owner;
+ }
+
+ public ComponentType getType()
+ {
+ return type;
+ }
+
+ public String toString()
+ {
+ StringBuilder tmp = new StringBuilder(super.toString());
+ tmp.append('{');
+ super.toString(tmp);
+ tmp.append(", type=");
+ tmp.append(type);
+ tmp.append(", owner=ManagedDeployment@");
+ tmp.append(System.identityHashCode(owner));
+ tmp.append('}');
+ return tmp.toString();
+ }
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedComponentImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedDeploymentImpl.java
===================================================================
--- projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedDeploymentImpl.java (rev 0)
+++ projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedDeploymentImpl.java 2007-07-25 17:22:17 UTC (rev 64275)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.plugins;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ * A simple
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ManagedDeploymentImpl extends BaseManagedObject
+ implements ManagedDeployment, Serializable
+{
+ private static final long serialVersionUID = 1;
+ private String name;
+ private Set<String> types;
+ private DeploymentPhase phase;
+ private ManagedDeployment parent;
+ private Map<String, ManagedComponent> components = new HashMap<String, ManagedComponent>();
+ private ArrayList<ManagedDeployment> children = new ArrayList<ManagedDeployment>();
+
+ ManagedDeploymentImpl(String name, DeploymentPhase phase,
+ Map<String, ManagedProperty> properties,
+ ManagedDeployment parent)
+ {
+ // TODO: simple vs full deployment name
+ super(name, properties);
+ this.name = name;
+ this.phase = phase;
+ this.parent = parent;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean addType(String type)
+ {
+ return types.add(type);
+ }
+ public Set<String> getTypes()
+ {
+ return types;
+ }
+ public void setTypes(Set<String> types)
+ {
+ this.types = types;
+ }
+
+ public DeploymentPhase getDeploymentPhase()
+ {
+ return phase;
+ }
+ public ManagedDeployment getParent()
+ {
+ return parent;
+ }
+
+ public Set<String> getComponentTemplateNames()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public void addComponent(String name, ManagedComponent comp)
+ {
+ }
+ public ManagedComponent getComponent(String name)
+ {
+ ManagedComponent mc = components.get(name);
+ return mc;
+ }
+
+
+ public Map<String, ManagedComponent> getComponents()
+ {
+ return components;
+ }
+
+ public boolean removeComponent(String name)
+ {
+ ManagedComponent mc = components.remove(name);
+ return mc != null;
+ }
+
+ public Set<String> getDeploymentTemplateNames()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public List<ManagedDeployment> getChildren()
+ {
+ return children;
+ }
+
+ public ManagedDeployment addModule(String deplymentBaseName, DeploymentTemplateInfo info)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String toString()
+ {
+ StringBuilder tmp = new StringBuilder(super.toString());
+ tmp.append('{');
+ super.toString(tmp);
+ tmp.append(", types=");
+ tmp.append(types);
+ tmp.append(", phase=");
+ tmp.append(phase);
+ tmp.append(", parent=");
+ if( parent != null )
+ {
+ tmp.append("ManagedDeployment@");
+ tmp.append(System.identityHashCode(parent));
+ }
+ else
+ {
+ tmp.append("null");
+ }
+ tmp.append(", components=");
+ tmp.append(components);
+ tmp.append(", children=");
+ tmp.append(children);
+ tmp.append('}');
+ return tmp.toString();
+ }
+
+}
Property changes on: projects/microcontainer/trunk/managed/src/main/org/jboss/managed/plugins/ManagedDeploymentImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list