[Jboss-cvs] JBossAS SVN: r56767 - in branches/MC_VDF_WORK/system/src/main/org/jboss: . deployers deployers/spi deployers/spi/management

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 12 09:05:09 EDT 2006


Author: adrian at jboss.org
Date: 2006-09-12 09:05:06 -0400 (Tue, 12 Sep 2006)
New Revision: 56767

Added:
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedObject.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedPropertyRef.java
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
Log:
Recreated stuff that should not be deleted yet, needed for compile.
I'm beginning to hate this svn client!

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java	2006-09-12 12:40:57 UTC (rev 56766)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/Deployment.java	2006-09-12 13:05:06 UTC (rev 56767)
@@ -0,0 +1,64 @@
+/*
+ * 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.deployers.spi;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.jboss.deployers.spi.management.ManagedObject;
+
+/**
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface Deployment
+{
+   /** The deployment name */
+   public String getName();
+   /** 
+    * The type of the root deployment context. This should correspond to
+    * the JSR88 type for the root DeploymentContext.
+    * @return JSR88 type for the root DeploymentContext
+    */
+   public String getType();
+   /**
+    * A set of all deployment context types
+    * @return
+    */
+   public Set<String> getTypes();
+   /**
+    * The root of the deployment contents
+    * @return the root URL of the deployment contents.
+    */
+   public URL getRootURL();
+   /** The deployment files, jars, resources paths relative to the rootURL */
+   public String[] getFiles();
+
+   public DeploymentContext getRootContext();
+
+   /**
+    * Get the management view used to edit the deployment.
+    * @return deployment management view
+    */
+   public ManagedObject getManagedObject();
+}

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java	2006-09-12 12:40:57 UTC (rev 56766)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentContext.java	2006-09-12 13:05:06 UTC (rev 56767)
@@ -0,0 +1,223 @@
+/*
+ * 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.deployers.spi;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+import org.jboss.util.JBossObject;
+import org.jboss.vfs.spi.VirtualFile;
+
+/**
+ * DeploymentContext represents a deployment aggregate (ear, jar, sar,
+ * deployment descriptor) that is processed by one ore more deployers to
+ * procude MC beans. 
+ * 
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 46234 $
+ */
+public class DeploymentContext extends JBossObject
+   implements Serializable
+{
+   private static final long serialVersionUID = 1;
+
+   // Protected Data ------------------------------------------------
+   protected VirtualFile file;
+   protected DeploymentContext parent;
+   protected Set<String> deploymentTypes = new CopyOnWriteArraySet<String>();
+   /** The list of VFS paths that form the classpath */
+   protected List<String> classpath = new ArrayList<String>();
+   protected List<DeploymentContext> subDeployments = new ArrayList<DeploymentContext>();
+   protected ConcurrentHashMap<Serializable, Serializable>
+      contextData = new ConcurrentHashMap<Serializable, Serializable>();
+   /** The current state of the deployment */
+   protected DeploymentState state = DeploymentState.CONSTRUCTED;
+   
+   // Constructors --------------------------------------------------
+   public DeploymentContext()
+   {
+   }
+   public DeploymentContext(VirtualFile file, DeploymentContext parent)
+   {
+      this.file = file;
+      this.parent = parent;
+   }
+
+   // Public --------------------------------------------------------
+
+   public VirtualFile getFile()
+   {
+      return file;
+   }
+   public void setFile(VirtualFile file)
+   {
+      this.file = file;
+   }
+
+   public Map<Serializable, Serializable> getContextData()
+   {
+      return contextData;
+   }
+
+   /**
+    * @return the parent context or null
+    */
+   public DeploymentContext getParentContext()
+   {
+      return parent;
+   }
+   public void setParentContext(DeploymentContext parent)
+   {
+      this.parent = parent;
+   }
+
+   /**
+    * @param state The state to set.
+    */
+   public void setState(DeploymentState state)
+   {
+      this.state = state;
+   }
+   
+   /**
+    * @return Returns the state.
+    */
+   public DeploymentState getState()
+   {
+      return state;
+   }
+
+   public boolean addDeploymentType(String type)
+   {
+      // TODO: if this is the first type should that be the main type?
+      return deploymentTypes.add(type);
+   }
+   public Set<String> getDeploymentTypes()
+   {
+      return deploymentTypes;
+   }
+   public boolean isDeploymentType(String type)
+   {
+      return deploymentTypes.contains(type);
+   }
+
+   /**
+    * Is the relative path in the deployment context classpath. 
+    * @param path - a relative path to the context VirtualFile. If 
+    * @return true if the classpath contains the path, false otherwise.
+    */
+   public boolean isInClasspath(String path)
+   {
+      return classpath.contains(path);
+   }
+
+   /**
+    * @return the classpath
+    */
+   public List<String> getClasspath()
+   {
+      return classpath;
+   }
+   
+   /**
+    * Adds an entry to the classpath
+    *  
+    * @param path the classpath to add
+    * @return true if the classpath has been added
+    */
+   public boolean addClasspathEntry(String path)
+   {
+      return classpath.add(path);
+   }
+   
+   /**
+    * Adds a child subdeployment
+    * 
+    * @param child the subdeployement
+    * @return true if subdeployment has been added
+    */
+   public boolean addSubDeployment(DeploymentContext child)
+   {
+      // add a child subdeployment
+      return subDeployments.add(child);
+   }
+  
+  /** 
+   * Gets the subdeployments of this context
+   * 
+   * @return a copy of the subdeployments
+   */
+  public List<DeploymentContext> getSubDeployments()
+  {
+     return new ArrayList<DeploymentContext>(subDeployments);
+  }   
+   /**
+    * Sets the children subdeployments
+    * 
+    * @param subDeployments
+    */
+   public void setSubDeployments(List<DeploymentContext> subDeployments)
+   {
+      if (subDeployments != null)
+      {
+         this.subDeployments.clear();
+         this.subDeployments.addAll(subDeployments);
+      }
+   }
+   
+   // JBossObject overrides -----------------------------------------
+   
+   public void toShortString(StringBuffer buffer)
+   {
+      // REVISIT
+      buffer.append(super.getClassShortName());
+   }
+   
+   protected void toString(StringBuffer buffer)
+   {
+      buffer.append(file.getPathName());
+   }
+   
+   protected int getHashCode()
+   {
+      return file.hashCode();
+   }
+   
+   // Object overrides ----------------------------------------------
+   
+   public boolean equals(Object other)
+   {
+      boolean equals = false;
+      if (other instanceof DeploymentContext)
+      {
+         DeploymentContext dc = (DeploymentContext) other;
+         equals = file.equals(dc.file);
+      }
+      return equals;
+   }
+
+}

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java	2006-09-12 12:40:57 UTC (rev 56766)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/DeploymentState.java	2006-09-12 13:05:06 UTC (rev 56767)
@@ -0,0 +1,139 @@
+/***************************************
+ *                                     *
+ *  JBoss: The OpenSource J2EE WebOS   *
+ *                                     *
+ *  Distributable under LGPL license.  *
+ *  See terms of license at gnu.org.   *
+ *                                     *
+ ***************************************/
+
+package org.jboss.deployers.spi;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+/** 
+ * A type-safe enumeration for the status of DeploymentContext
+ * based on Scott's original class.
+ *
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @version $Revision: 46233 $
+ */
+public class DeploymentState implements Serializable
+{
+   private static final long serialVersionUID = 1;
+
+   // Static --------------------------------------------------------
+   
+   /** DeploymentContext constructed */
+   public static final DeploymentState CONSTRUCTED = new DeploymentState("CONSTRUCTED");
+   
+   /** None of the registered AspectDeployer could analyze the deployment */ 
+   public static final DeploymentState WAITING_DEPLOYER = new DeploymentState("WAITING_DEPLOYER");
+   
+   /** The deployment structure has been analyzed by an AspectDeployer, but not the subdeployments yet */
+   public static final DeploymentState ANALYZED_ROOT = new DeploymentState("ANALYZED_ROOT");
+   
+   /** The deployment structure, including subdeployments, has been analyzed */
+   public static final DeploymentState ANALYZED = new DeploymentState("ANALYZED");   
+   
+//   public static final DeploymentState INIT_DEPLOYER = new DeploymentState("INIT_DEPLOYER");
+//   public static final DeploymentState INITIALIZED = new DeploymentState("INITIALIZED");
+//
+//   public static final DeploymentState CREATE_SUBDEPLOYMENTS = new DeploymentState("CREATE_SUBDEPLOYMENTS");
+//   public static final DeploymentState CREATE_DEPLOYER = new DeploymentState("CREATE_DEPLOYER");
+//   public static final DeploymentState CREATED = new DeploymentState("CREATED");
+//
+//   public static final DeploymentState START_SUBDEPLOYMENTS = new DeploymentState("START_SUBDEPLOYMENTS");
+//   public static final DeploymentState START_DEPLOYER = new DeploymentState("START_DEPLOYER");
+//   public static final DeploymentState STARTED = new DeploymentState("STARTED");
+//
+//   public static final DeploymentState STOPPED = new DeploymentState("STOPPED");
+//   public static final DeploymentState DESTROYED = new DeploymentState("DESTROYED");
+   
+   /** The deployment failed at any point */
+   public static final DeploymentState FAILED = new DeploymentState("FAILED");
+
+   /** 
+    * A factory to translate a string into the corresponding DeploymentState.
+    */
+   public static DeploymentState getDeploymentState(String state)
+   {
+      DeploymentState theState = null;
+
+      state = state.toUpperCase();   
+      if (state.equals("CONSTRUCTED"))
+      {
+         theState = CONSTRUCTED;
+      }
+      else if (state.equals("WAITING_DEPLOYER"))
+      {
+         theState = WAITING_DEPLOYER;
+      }
+      else if (state.equals("ANALYZED_ROOT"))
+      {
+         theState = ANALYZED_ROOT;
+      }
+      else if (state.equals("ANALYZED"))
+      {
+         theState = ANALYZED;
+      }
+      else if (state.equals("FAILED"))
+      {
+         theState = FAILED;
+      }
+//      else if (state.equals("INITIALIZED"))
+//         theState = INITIALIZED;
+//      else if (state.equals("CREATE_SUBDEPLOYMENTS"))
+//         theState = CREATE_SUBDEPLOYMENTS;
+//      else if (state.equals("CREATE_DEPLOYER"))
+//         theState = CREATE_DEPLOYER;
+//      else if (state.equals("CREATED"))
+//         theState = CREATED;
+//      else if (state.equals("START_SUBDEPLOYMENTS"))
+//         theState = START_SUBDEPLOYMENTS;
+//      else if (state.equals("START_DEPLOYER"))
+//         theState = START_DEPLOYER;
+//      else if (state.equals("STARTED"))
+//         theState = STARTED;
+//      else if (state.equals("STOPPED"))
+//         theState = STOPPED;
+//      else if (state.equals("DESTROYED"))
+//         theState = DESTROYED;
+
+      return theState;
+   }
+   
+   // Private Data --------------------------------------------------
+   
+   private String state;
+   
+   // Constructors --------------------------------------------------
+   
+   /**
+    * Private CTOR
+    */
+   private DeploymentState(String state)
+   {
+      this.state = state;
+   }
+
+   // Private -------------------------------------------------------
+   
+   /**
+    * Resolve objects on deserialization to one of the identity objects.
+    */
+   private Object readResolve() throws ObjectStreamException
+   {
+      Object identity = getDeploymentState(state);
+      return identity;
+   }
+    
+   // Object overrides ----------------------------------------------
+   
+   public String toString()
+   {
+      return state;
+   }
+
+}

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java	2006-09-12 12:40:57 UTC (rev 56766)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/MainDeployer.java	2006-09-12 13:05:06 UTC (rev 56767)
@@ -0,0 +1,144 @@
+/*
+ * 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.deployers.spi;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.vfs.VFSFactory;
+
+/**
+ * The new MainDeployer service provider interface 
+ * 
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 46165 $
+ */
+public interface MainDeployer
+{
+   /**
+    * Get the VFSFactory used to handle deployments
+    * @return factory - VFSFactory implementation 
+    */
+   public VFSFactory getVFSFactory();
+   /**
+    * Set the VFSFactory used to handle deployments
+    * @param factory - VFSFactory implementation 
+    */
+   public void setVFSFactory(VFSFactory factory);
+
+   // Deployer registry ---------------------------------------------
+   
+   /**
+    * Register an AspectDeployer
+    * 
+    * @param deployer the AspectDeployer
+    */
+   //void register(AspectDeployer deployer);
+   
+   /**
+    * Unregister an AspectDeployer
+    * 
+    * @param deployer the AspectDeployer
+    */
+   //void unregister(AspectDeployer deployer);
+   
+   /**
+    * Return a copy of the AspectDeployer list
+    * 
+    * @return List<AspectDeployer>
+    */
+   //List<AspectDeployer> listDeployers();
+   
+   /**
+    * Return the ordered list of deployment suffixes
+    * recognized by registered AspectDeployers
+    * 
+    * @return the ordered list of recognized suffixes
+    */
+   public String[] getSuffixes();
+   
+   // Deployment ---------------------------------------
+
+   /**
+    * @return the DeploymentGraphBuilder plugin
+    */
+   //public DeploymentGraphBuilder getGraphBuilder();
+   /**
+    * The plugin that determines the directed graph of DeploymentContexts for
+    * a given Deployment.
+    * 
+    * @param builder - the DeploymentGraphBuilder plugin
+    */
+   //public void setGraphBuilder(DeploymentGraphBuilder builder);
+
+   /**
+    * Translate a deployment archive into a Deployment instance.
+    * @param deployURI - URI for the deployment archive
+    */
+   public Deployment parse(URI deployURI) throws DeploymentException;
+   /**
+    * Translate a deployment archive into a Deployment instance.
+    * @param deployURL - URL for the deployment archive
+    */
+   public Deployment parse(URL deployURL) throws DeploymentException;
+
+   /**
+    * Deploys a component
+    *
+    * @param comp the component to deploy
+    * @throws DeploymentException upon failure
+    */
+   void deploy(Deployment comp) throws DeploymentException;
+
+   /**
+    * Re-deploys a component
+    *
+    * @param comp the component to redeploy
+    * @throws DeploymentException upon failure
+    */
+   void redeploy(Deployment comp) throws DeploymentException;
+   
+   /**
+    * Undeploys a component
+    *
+    * @param comp the component to undeploy
+    * @throws DeploymentException upon failure
+    */
+   void undeploy(Deployment comp) throws DeploymentException;
+
+   /**
+    * Tells you if a component is deployed
+    *
+    * @param comp the component to check if is deployed
+    * @return the deployment status
+    */
+   boolean isDeployed(Deployment comp);
+
+   /**
+    * Undeploy all deployments
+    * @throws DeploymentException upon failure
+    */
+   public void shutdown() throws DeploymentException;
+
+}

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedObject.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedObject.java	2006-09-12 12:40:57 UTC (rev 56766)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedObject.java	2006-09-12 13:05:06 UTC (rev 56767)
@@ -0,0 +1,68 @@
+/*
+ * 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.deployers.spi.management;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.profileservice.spi.PropertyInfo;
+
+/**
+ * A collection of the properties making up a deployment managed object
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ManagedObject
+   implements Serializable
+{
+   private static final long serialVersionUID = 1;
+
+   private ArrayList<PropertyInfo> properties = new ArrayList<PropertyInfo>();
+
+   public ManagedObject()
+   {
+   }
+
+   public List<PropertyInfo> getProperties()
+   {
+      return properties;
+   }
+
+   public boolean addPropertyRef(PropertyInfo ref)
+   {
+      return properties.add(ref);
+   }
+   public boolean removePropertyRef(PropertyInfo ref)
+   {
+      return properties.remove(ref);
+   }
+   public int getSize()
+   {
+      return properties.size();
+   }
+   public void clear()
+   {
+      properties.clear();
+   }
+}

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedPropertyRef.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedPropertyRef.java	2006-09-12 12:40:57 UTC (rev 56766)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagedPropertyRef.java	2006-09-12 13:05:06 UTC (rev 56767)
@@ -0,0 +1,120 @@
+/*
+ * 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.deployers.spi.management;
+
+/**
+ * A management view wrapper of a bean property.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ManagedPropertyRef
+{
+   /**
+    * A namespace context that maps the managed property onto a managed view
+    * context (e.g., /, /DataSource, /DataSource/Pool).
+    */
+   private String context;
+   /**
+    * The DeploymentBean name which sources the property
+    * @return
+    */
+   private String beanName;
+   /**
+    * The DeploymentBean property name
+    */
+   private String propertyName;
+   /**
+    * An option management view description of the property
+    */
+   private String description;
+
+   /**
+    * Create a managed property ref for the indicated bean property.
+    * @param context
+    * @param beanName
+    * @param propertyName
+    * @param description
+    */
+   public ManagedPropertyRef(String context, String beanName,
+      String propertyName, String description)
+   {
+      this.context = context;
+      this.beanName = beanName;
+      this.propertyName = propertyName;
+      this.description = description;
+   }
+
+   /**
+    * @return Returns the beanName.
+    */
+   public String getBeanName()
+   {
+      return this.beanName;
+   }
+
+   /**
+    * @return Returns the context.
+    */
+   public String getContext()
+   {
+      return this.context;
+   }
+
+   /**
+    * @return Returns the description.
+    */
+   public String getDescription()
+   {
+      return this.description;
+   }
+
+   /**
+    * @return Returns the propertyName.
+    */
+   public String getPropertyName()
+   {
+      return this.propertyName;
+   }
+
+   /**
+    * Equality based on beanName + propertyName
+    */
+   public boolean equals(Object obj)
+   {
+      ManagedPropertyRef ref = (ManagedPropertyRef) obj;
+      boolean equals = beanName.equals(ref.beanName);
+      if( equals )
+      {
+         equals = propertyName.equals(ref.propertyName);
+      }
+      return equals;
+   }
+
+   /**
+    * Hash based on beanName + propertyName
+    */
+   public int hashCode()
+   {
+      return beanName.hashCode() + propertyName.hashCode();
+   }
+}

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagementView.java	2006-09-12 12:40:57 UTC (rev 56766)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/spi/management/ManagementView.java	2006-09-12 13:05:06 UTC (rev 56767)
@@ -0,0 +1,52 @@
+/*
+  * 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.deployers.spi.management;
+
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.NoSuchProfileException;
+
+/**
+ * The management view plugin spi for querying profiles for the
+ * deployemnt management object interface roots.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public interface ManagementView
+{
+   /**
+    * Obtain the top-level management view for a deployment. This is
+    * done by identifying all DeploymentBeans annotated with
+    * @link{org.jboss.annotation.management.ManagedObject}
+    * 
+    * @param key - the profile containing the deployment
+    * @param deploymentName - the name of deployment
+    * @return the root management view
+    * @throws NoSuchProfileException
+    * @throws NoSuchDeploymentException 
+    */
+   public ManagedObject getView(ProfileKey key, String deploymentName)
+      throws NoSuchProfileException, NoSuchDeploymentException;
+
+}




More information about the jboss-cvs-commits mailing list