[jboss-cvs] JBossAS SVN: r59583 - in trunk/profileservice: src/etc and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 12 02:25:58 EST 2007


Author: scott.stark at jboss.org
Date: 2007-01-12 02:25:49 -0500 (Fri, 12 Jan 2007)
New Revision: 59583

Added:
   trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/builders/
   trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ConnectionFactoryDeployerManagedObjectBuilder.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/plugins/
   trunk/profileservice/src/main/org/jboss/profileservice/management/plugins/BasicDeploymentTemplateInfo.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/templates/
   trunk/profileservice/src/main/org/jboss/profileservice/management/templates/DsXmlDataSourceTemplate.java
Removed:
   trunk/profileservice/src/etc/run.mf
Modified:
   trunk/profileservice/
   trunk/profileservice/.classpath
   trunk/profileservice/build.log
   trunk/profileservice/build.xml
   trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProfileServiceInvocationHandler.java
   trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProxyFactory.java
   trunk/profileservice/src/resources/profileservice-beans.xml
Log:
A profile service project for the extended features that should be outside of the bootstrap code


Property changes on: trunk/profileservice
___________________________________________________________________
Name: svn:ignore
   + output


Modified: trunk/profileservice/.classpath
===================================================================
--- trunk/profileservice/.classpath	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/.classpath	2007-01-12 07:25:49 UTC (rev 59583)
@@ -23,5 +23,6 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/remoting/lib/jboss-remoting.jar" sourcepath="/thirdparty/jboss/remoting/lib/jboss-remoting-src.zip"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/aspects"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/system"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/system-jmx"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/profileservice/build.log
===================================================================
--- trunk/profileservice/build.log	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/build.log	2007-01-12 07:25:49 UTC (rev 59583)
@@ -19,7 +19,12 @@
 init:
 
 _default:compile-classes:
+   [depend] Deleted 1 out of date files in 0 seconds
     [javac] Compiling 1 source file to /home/svn/JBossHead/jboss-head/profileservice/output/classes
+    [javac] /home/svn/JBossHead/jboss-head/profileservice/src/main/org/jboss/profileservice/management/builders/ConnectionFactoryDeployerManagedObjectBuilder.java:59: warning: [deprecation] getDeploymentContext() in org.jboss.deployers.spi.deployer.DeploymentUnit has been deprecated
+    [javac]          Set<DeploymentContext> comps = unit.getDeploymentContext().getComponents();
+    [javac]                                             ^
+    [javac] 1 warning
 
 _default:compile-resources:
 

Modified: trunk/profileservice/build.xml
===================================================================
--- trunk/profileservice/build.xml	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/build.xml	2007-01-12 07:25:49 UTC (rev 59583)
@@ -77,6 +77,7 @@
       <path refid="jboss.microcontainer.classpath"/>
       <path refid="jboss.remoting.classpath"/>
       <path refid="jboss.system.classpath"/>
+      <path refid="jboss.systemjmx.classpath"/>
     </path>
 
     <!-- The combined dependant module classpath -->

Deleted: trunk/profileservice/src/etc/run.mf
===================================================================
--- trunk/profileservice/src/etc/run.mf	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/etc/run.mf	2007-01-12 07:25:49 UTC (rev 59583)
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Created-By: @java.vm.version@ (@java.vm.vendor@)
-Specification-Title: @specification.title@
-Specification-Version: @specification.version@
-Specification-Vendor: @specification.vendor@
-Implementation-Title: @implementation.title@
-Implementation-URL: @implementation.url@
-Implementation-Version: @implementation.version@
-Implementation-Vendor: @implementation.vendor@
-Implementation-Vendor-Id: @implementation.vendor.id@
-Main-Class: org.jboss.Main
-Class-Path: ../client/getopt.jar

Added: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2007-01-12 07:25:49 UTC (rev 59583)
@@ -0,0 +1,175 @@
+/*
+  * 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.profileservice.management;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.IncompleteDeploymentException;
+import org.jboss.deployers.spi.IncompleteDeployments;
+import org.jboss.deployers.spi.IncompleteDeploymentsBuilder;
+import org.jboss.deployers.spi.deployer.Deployer;
+import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.spi.management.DeploymentTemplate;
+import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.profileservice.spi.Profile.DeploymentPhase;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class ManagementViewImpl
+   implements ManagementView
+{
+   private ProfileService ps;
+   private MainDeployer mainDeployer;
+   private HashMap<String, DeploymentTemplate> templates = new HashMap<String, DeploymentTemplate>();
+
+   public ProfileService getProfileService()
+   {
+      return ps;
+   }
+   public void setProfileService(ProfileService ps)
+   {
+      this.ps = ps;
+   }
+
+   public MainDeployer getMainDeployer()
+   {
+      return mainDeployer;
+   }
+   public void setMainDeployer(MainDeployer mainDeployer)
+   {
+      this.mainDeployer = mainDeployer;
+   }
+
+   public Set<String> getTemplateNames()
+   {
+      HashSet<String> tmp = new HashSet<String>(templates.keySet());
+      return tmp;
+   }
+   public void addTemplate(DeploymentTemplate template)
+   {
+      this.templates.put(template.getInfo().getName(), template);
+   }
+   public void removeTemplate(DeploymentTemplate template)
+   {
+      this.templates.remove(template.getInfo().getName());
+   }
+
+   public ManagedObject getView(ProfileKey key, String deploymentName, DeploymentPhase phase)
+      throws NoSuchProfileException, NoSuchDeploymentException, Exception
+   {
+      Profile profile = ps.getProfile(key);
+      DeploymentContext d = profile.getDeployment(deploymentName, phase);
+      mainDeployer.getManagedObjects(deploymentName);
+      // return mo;
+      return null;
+   }
+
+   public void setView(ProfileKey key, String deploymentName, HashMap<String, ManagedProperty> view)
+      throws NoSuchProfileException, IOException
+   {
+   }
+
+   public DeploymentTemplateInfo getTemplate(String name)
+      throws NoSuchDeploymentException
+   {
+      DeploymentTemplate template = templates.get(name);
+      if( template == null )
+         throw new NoSuchDeploymentException("No template for: "+name);
+      DeploymentTemplateInfo info = template.getInfo();
+      return info;
+   }
+
+   public void applyTemplate(ProfileKey key, DeploymentPhase phase,
+      String deploymentBaseName, DeploymentTemplateInfo info)
+      throws Exception
+   {
+      DeploymentTemplate template = templates.get(info.getName());
+      if( template == null )
+      {
+         throw new IllegalStateException("Failed to find template for: "+info.getName());
+      }
+
+      Profile profile = ps.getProfile(key);
+      if( profile == null )
+         throw new NoSuchProfileException("No profile for key: "+key);
+
+      // Create a deployment base from the template
+      VirtualFile root = profile.getRootFile(phase);
+      VirtualFile deployment = template.applyTemplate(root, deploymentBaseName, info);
+      AbstractDeploymentContext ctx = new AbstractDeploymentContext(deployment);
+      profile.addDeployment(ctx, phase);
+
+      // Process the base deployment
+      mainDeployer.addDeploymentContext(ctx);
+      Collection<DeploymentContext> ctxs = mainDeployer.process(-1, Deployer.CLASSLOADER_DEPLOYER);
+      checkIncomplete();
+      for (DeploymentContext d : ctxs)
+      {
+         profile.updateDeployment(d, DeploymentPhase.BOOTSTRAP);
+      }
+      // Apply the managed properties
+      Map<String, ManagedObject> mos = mainDeployer.getManagedObjects(ctx);
+      // Now 
+
+      for(ManagedProperty prop : info.getProperties())
+      {
+         ManagedObject mo = prop.getManagedObject();
+         ManagedObject ctxMO = mos.get(mo.getName());
+         ManagedProperty ctxProp = ctxMO.getProperty(prop.getName());
+         ctxProp.setValue((Serializable)prop.getValue());
+      }
+   }
+
+   /**
+    * Check whether we are incomplete
+    * 
+    * @throws DeploymentException the deployment exception
+    */
+   protected void checkIncomplete() throws DeploymentException
+   {
+      IncompleteDeployments incomplete = IncompleteDeploymentsBuilder.build(mainDeployer, null);
+      if (incomplete.isIncomplete())
+         throw new IncompleteDeploymentException(incomplete);
+   }
+
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ConnectionFactoryDeployerManagedObjectBuilder.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ConnectionFactoryDeployerManagedObjectBuilder.java	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ConnectionFactoryDeployerManagedObjectBuilder.java	2007-01-12 07:25:49 UTC (rev 59583)
@@ -0,0 +1,67 @@
+/*
+ * 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.profileservice.management.builders;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.managed.ManagedObjectBuilder;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.system.metadata.ServiceDeployment;
+import org.jboss.system.metadata.ServiceMetaData;
+
+/**
+ * A ManagedObjectBuilder for use as an override to the ConnectionFactoryDeployer
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class ConnectionFactoryDeployerManagedObjectBuilder
+   implements ManagedObjectBuilder
+{
+   private static Logger log = Logger.getLogger(ConnectionFactoryDeployerManagedObjectBuilder.class);
+
+   public void build(DeploymentUnit unit, Map<String, ManagedObject> map) 
+      throws DeploymentException
+   {
+      String name = unit.getSimpleName();
+      if(name.endsWith("-ds.xml"))
+      {
+         // This is just dumping out info to see what we should map...
+         Map<String, Object> attachments = unit.getAttachments();
+         log.info(name+" attachments: "+attachments);
+         ServiceDeployment dsMetaData = unit.getAttachment(ServiceDeployment.class);
+         List<ServiceMetaData> services = dsMetaData.getServices();
+         log.info(name+" services: "+services);
+         Set<DeploymentContext> comps = unit.getDeploymentContext().getComponents();
+         for(DeploymentContext ctx : comps)
+         {
+            log.info(ctx+": "+ctx.getTransientManagedObjects());            
+         }
+      }
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ConnectionFactoryDeployerManagedObjectBuilder.java
___________________________________________________________________
Name: svn:keywords
   + Id,Revision
Name: svn:eol-style
   + native

Added: trunk/profileservice/src/main/org/jboss/profileservice/management/plugins/BasicDeploymentTemplateInfo.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/plugins/BasicDeploymentTemplateInfo.java	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/plugins/BasicDeploymentTemplateInfo.java	2007-01-12 07:25:49 UTC (rev 59583)
@@ -0,0 +1,72 @@
+/*
+ * 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.profileservice.management.plugins;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedProperty;
+
+public class BasicDeploymentTemplateInfo
+   implements DeploymentTemplateInfo, Serializable
+{
+   private static final long serialVersionUID = 1;
+   private String name;
+   private String description;
+   private Set<ManagedProperty> properties;
+
+   public BasicDeploymentTemplateInfo(String name, String description)
+   {
+      this(name, description, null);
+   }
+   public BasicDeploymentTemplateInfo(String name, String description, Set<ManagedProperty> properties)
+   {
+      this.name = name;
+      this.description = description;
+      this.properties = properties;
+   }
+
+   public String getDescription()
+   {
+      return description;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public Set<ManagedProperty> getProperties()
+   {
+      return properties;
+   }
+   public void setProperties(Set<ManagedProperty> properties)
+   {
+      this.properties = properties;
+   }
+   public void addProperty(ManagedProperty property)
+   {
+      this.properties.add(property);
+   }
+   
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/plugins/BasicDeploymentTemplateInfo.java
___________________________________________________________________
Name: svn:keywords
   + Id,Revision
Name: svn:eol-style
   + native

Added: trunk/profileservice/src/main/org/jboss/profileservice/management/templates/DsXmlDataSourceTemplate.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/templates/DsXmlDataSourceTemplate.java	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/templates/DsXmlDataSourceTemplate.java	2007-01-12 07:25:49 UTC (rev 59583)
@@ -0,0 +1,80 @@
+/*
+ * 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.profileservice.management.templates;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.net.URI;
+
+import org.jboss.deployers.spi.management.DeploymentTemplate;
+import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A template for creating a datasource(*-ds.xml) deployments.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class DsXmlDataSourceTemplate
+   implements DeploymentTemplate
+{
+   private DeploymentTemplateInfo info;
+
+   /**
+    * Creates a root/{deploymentBaseName}-ds.xml base descriptor.
+    */
+   public VirtualFile applyTemplate(VirtualFile root, String deploymentBaseName,
+         DeploymentTemplateInfo values)
+      throws Exception
+   {
+      String dsName = deploymentBaseName+"-ds.xml";
+      URI dsXmlURI = new URI(root.toURI()+dsName);
+      File dsXml = new File(dsXmlURI.getPath());
+      writeTemplate(dsXml, values);
+      VirtualFile dsXmlVF = root.findChild(dsName);
+      return dsXmlVF;
+   }
+
+   public DeploymentTemplateInfo getInfo()
+   {
+      return info;
+   }
+   public void setInfo(DeploymentTemplateInfo info)
+   {
+      this.info = info;
+   }
+
+   protected void writeTemplate(File dsXml, DeploymentTemplateInfo values)
+      throws Exception
+   {
+      FileWriter fw = new FileWriter(dsXml);
+      fw.write("<datasources>\n");
+      fw.write("<local-tx-datasource>\n");
+      fw.write("<jndi-name>DefaultDS</jndi-name>\n");
+      fw.write("<connection-url>jdbc:...</connection-url>\n");
+      fw.write("</local-tx-datasource>\n");
+      fw.write("</datasources>\n");
+      fw.flush();
+      fw.close();
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/templates/DsXmlDataSourceTemplate.java
___________________________________________________________________
Name: svn:keywords
   + Id,Revision
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProfileServiceInvocationHandler.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProfileServiceInvocationHandler.java	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProfileServiceInvocationHandler.java	2007-01-12 07:25:49 UTC (rev 59583)
@@ -21,6 +21,7 @@
  */
 package org.jboss.profileservice.remoting;
 
+import org.jboss.aop.joinpoint.InvocationResponse;
 import org.jboss.aop.proxy.Proxy;
 import org.jboss.aspects.remoting.AOPRemotingInvocationHandler;
 import org.jboss.deployers.spi.management.ManagementView;
@@ -53,9 +54,12 @@
    public Object invoke(InvocationRequest invocation)
       throws Throwable
    {
-      Object value = super.invoke(invocation);
-      if( value instanceof ManagementView )
-         value = mgtViewProxy;
+      InvocationResponse value = (InvocationResponse) super.invoke(invocation);
+      if( value.getResponse() instanceof ManagementView )
+      {
+         // Replace the ManagementView with its proxy
+         value.setResponse(mgtViewProxy);
+      }
       return value;
    }
 

Modified: trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProxyFactory.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProxyFactory.java	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/main/org/jboss/profileservice/remoting/ProxyFactory.java	2007-01-12 07:25:49 UTC (rev 59583)
@@ -29,6 +29,7 @@
 import org.jboss.aop.advice.Interceptor;
 import org.jboss.aop.proxy.Proxy;
 import org.jboss.aspects.remoting.InvokeRemoteInterceptor;
+import org.jboss.aspects.remoting.MergeMetaDataInterceptor;
 import org.jboss.aspects.remoting.Remoting;
 import org.jboss.aspects.security.SecurityClientInterceptor;
 import org.jboss.deployers.spi.management.ManagementView;
@@ -112,6 +113,7 @@
 
       ArrayList<Interceptor> interceptors = new ArrayList<Interceptor>();
       interceptors.add(SecurityClientInterceptor.singleton);
+      interceptors.add(MergeMetaDataInterceptor.singleton);
       interceptors.add(InvokeRemoteInterceptor.singleton);
 
       psProxy = Remoting.createRemoteProxy(dispatchName, loader, ifaces, locator,
@@ -121,9 +123,10 @@
 
       // Create the ManagementView proxy
       ManagementView mv = ps.getViewManager();
+      Class[] mvIfaces = {ManagementView.class};
       String mvDispatchName = dispatchName+".ManagementView";
       Dispatcher.singleton.registerTarget(mvDispatchName, mv);
-      mgtViewProxy = Remoting.createRemoteProxy(mvDispatchName, loader, ifaces, locator,
+      mgtViewProxy = Remoting.createRemoteProxy(mvDispatchName, loader, mvIfaces, locator,
             interceptors, "ProfileService");
    }
 

Modified: trunk/profileservice/src/resources/profileservice-beans.xml
===================================================================
--- trunk/profileservice/src/resources/profileservice-beans.xml	2007-01-12 04:53:55 UTC (rev 59582)
+++ trunk/profileservice/src/resources/profileservice-beans.xml	2007-01-12 07:25:49 UTC (rev 59583)
@@ -4,27 +4,91 @@
     ProfileService beans that extend the bootstrap configuration. This
     includes:
     Remote access to ProfileService interfaces
+    ManagementView plugin + DeploymentTemplates
     ...
+    $Id$
 -->
 <deployment xmlns="urn:jboss:bean-deployer:2.0">
-    <bean name="ProfileServiceProxyFactory" class="org.jboss.system.server.profileservice.repository.FileProfileRepository">
-        <property name="storeRoot">${jboss.server.base.dir}</property>
-        <property name="repositoryFactory"><inject bean="SerializableDeploymentRepositoryFactory"/></property>
-        <!-- Remoting  -->
+    <bean name="ConnectorMBean">
+        <constructor factoryClass="org.jboss.mx.util.MBeanTyper" factoryMethod="typeMBean">
+            <parameter><inject bean="JMXKernel" property="mbeanServer"/></parameter>
+            <parameter>jboss.remoting:service=Connector,transport=socket</parameter>
+            <parameter>org.jboss.remoting.transport.ConnectorMBean</parameter>
+        </constructor>
         <depends>jboss.remoting:service=Connector,transport=socket</depends>
     </bean>
-
     <!--
         Add a ProfileService handler to the remoting socket connector
     -->
     <bean name="ProfileServiceInvocationHandler"
-        class="org.jboss.aspects.remoting.AOPRemotingInvocationHandler">
-        <install bean="jboss.remoting:service=Connector,transport=socket" method="addInvocationHandler">
+        class="org.jboss.profileservice.remoting.ProfileServiceInvocationHandler">
+        <install bean="ConnectorMBean" method="addInvocationHandler">
             <parameter>ProfileService</parameter>
             <parameter><this/></parameter>
         </install>
-        <uninstall bean="jboss.remoting:service=Connector,transport=socket" method="removeInvocationHandler">
+        <uninstall bean="ConnectorMBean" method="removeInvocationHandler">
             <parameter>ProfileService</parameter>
         </uninstall>
+        <property name="managementViewProxy"><inject bean="ProfileServiceProxyFactory" property="managementViewProxy"/></property>
     </bean>
+    
+    <!-- The ManagementView plugin -->
+    <bean name="ManagementView" class="org.jboss.profileservice.management.ManagementViewImpl">
+        <install bean="ProfileService" method="setViewManager">
+            <parameter>
+                <this/>
+            </parameter>
+        </install>
+        <uninstall bean="ProfileService" method="setViewManager">
+            <parameter>
+                <null/>
+            </parameter>
+        </uninstall>
+        <property name="mainDeployer"><inject bean="MainDeployer"/></property>
+        <property name="profileService"><inject bean="ProfileService"/></property>
+    </bean>
+    <!-- DeploymentTemplates -->
+    <bean name="DsXmlDataSourceTemplate" class="org.jboss.profileservice.management.templates.DsXmlDataSourceTemplate">
+        <install bean="ManagementView" method="addTemplate">
+            <parameter>
+                <this/>
+            </parameter>
+        </install>
+        <uninstall bean="ManagementView" method="removeTemplate">
+            <parameter>
+                <this/>
+            </parameter>
+        </uninstall>
+        <property name="info"><inject bean="DsXmlDataSourceTemplateInfo"/></property>
+    </bean>
+    <bean name="DsXmlDataSourceTemplateInfo"
+        class="org.jboss.profileservice.management.plugins.BasicDeploymentTemplateInfo">
+        <constructor>
+            <parameter>DsXmlDataSourceTemplate</parameter>
+            <parameter>A template for *-ds.xml deployments</parameter>
+        </constructor>
+    </bean>
+    
+    <!-- Override the ConnectionFactoryDeployer ManagedObjectBuilder -->
+    <bean name="ConnectionFactoryDeployerManagedObjectBuilder"
+        class="org.jboss.profileservice.management.builders.ConnectionFactoryDeployerManagedObjectBuilder">
+        <install bean="MainDeployer" method="setDeployerManagedObjectBuilder">
+            <parameter>
+                <inject bean="ConnectionFactoryDeployer" />
+            </parameter>
+            <parameter>
+                <this/>
+            </parameter>
+        </install>
+    </bean>
+    
+    <bean name="ProfileServiceProxyFactory" class="org.jboss.profileservice.remoting.ProxyFactory">
+        <property name="dispatchName">ProfileService</property>
+        <property name="jndiName">ProfileService</property>
+        <property name="locator"><inject bean="ConnectorMBean" property="invokerLocator"/></property>
+        <property name="profileService"><inject bean="ProfileService"/></property>
+        <depends>ConnectorMBean</depends>
+        <depends>ManagementView</depends>
+    </bean>
+    
 </deployment>


Property changes on: trunk/profileservice/src/resources/profileservice-beans.xml
___________________________________________________________________
Name: svn:keywords
   + Id, Revision




More information about the jboss-cvs-commits mailing list