5 Replies Latest reply on Apr 26, 2007 6:49 PM by starksm64

    Remove Resource - removes entire deployment, the whole file.

      If I delete a DataSource ManagedComponent it deletes the xxx-ds.xml file. But what happens if there are more than
      one datasource defined in the xxx-ds.xml file. Or what if the ManagedComponent was a SecurityDomain in the login-config.xml
      or a Queue or Topic defined in the destinations xml file. It should just remove that entry, and not necessariy delete
      the xml file.

      Thanks

      Mark

        • 1. Re: Remove Resource - removes entire deployment, the whole f
          starksm64

          The original deployment descriptor should be irrelevant as it should be overriden by its pojo metadata form. DataSources created via the profile service will never have more than one entry in a ds.xml. Whether or not a ds.xml is even created is a function of the deployment template.

          • 2. Re: Remove Resource - removes entire deployment, the whole f
            weston.price

             


            DataSources created via the profile service will never have more than one entry in a ds.xml. Whether or not a ds.xml is even created is a function of the deployment template.


            But the profile service should be able to use a *-ds.xml file with multiple datasources/cf's in it right?



            • 3. Re: Remove Resource - removes entire deployment, the whole f
              starksm64

              Its not really the profile service that has to deal with this. Its the DeploymentTemplates and ManagedObjects defined by the deployers as these need to be in synch with the way the deployers handle metadata. Right now the DataSource management layer is just hacked in as an override by profile service local classes.

              In general, a parsing deployer translates a descriptor into a pojo metadata view, and operations on the metadata view may or may not affect the descriptor. It depends on how the ManagedObject/ManagedProperty instances handle changes. Typically I would expect that the descriptor simply becomes obsolete as it would be overriden by the pojo metadata view. The persistent form of the pojo metadata view may be java serialized objects, another xml document, or something else. This is an implementation detail of the DeploymentRepository currently. The current file based DeploymentRepository implementation defines an AttachmentsSerializer spi to control this. As I go through the OSGi bundle repository notions I'll refactor this. After that I need to go through and update the profile service diagrams to show how all the pieces fit together in terms of how the deployment metadata is built up.

              • 4. Re: Remove Resource - removes entire deployment, the whole f
                weston.price

                Dude, I am more than willing to help with this. However, I really don't get where this is all headed. Is there some form of doc/explanation where I can start to kick this in gear?

                • 5. Re: Remove Resource - removes entire deployment, the whole f
                  starksm64

                  Only the current profileservice module use of these classes:

                  org.jboss.profileservice.management.templates.DsXmlDataSourceTemplate
                  org.jboss.profileservice.management.builders.ConnectionFactoryDeployerManagedObjectBuilder
                  org.jboss.profileservice.management.builders.DomDataSourceManagedObject

                  and registration of these in the profileservice-beans.xml is all that exists in the current prototype. Once I get the DeploymentRepository updated I'll start documenting the management requirements for deployers. Essentially the DataSource deployer needs to take ownership of the ConnectionFactoryDeployerManagedObjectBuilder by having the deployer implement the org.jboss.deployers.spi.managed.ManagedObjectBuilder interface so that the ManagedObject for a DeploymentUnit can be obtained.

                  <?xml version="1.0" encoding="UTF-8"?>
                  
                  <!--
                   ProfileService beans that extend the bootstrap configuration. This
                   includes:
                   Remote access to ProfileService interfaces
                   ManagementView plugin + DeploymentTemplates
                   ...
                   $Id: profileservice-beans.xml 62170 2007-04-06 19:42:23Z scott.stark@jboss.org $
                  -->
                  <deployment xmlns="urn:jboss:bean-deployer:2.0">
                   <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.profileservice.remoting.ProfileServiceInvocationHandler">
                   <install bean="ConnectorMBean" method="addInvocationHandler">
                   <parameter>ProfileService</parameter>
                   <parameter><this/></parameter>
                   </install>
                   <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>
                   <property name="compVisitor"><inject bean="ComponentTypeOverridesVisitor"/></property>
                   <property name="serializer"><inject bean="JavaSerializationAttachmentsSerializer"/></property>
                   </bean>
                  
                   <!-- ConnectionFactory Deployment -->
                   <bean name="FakeDataSourceDeployer"
                   class="org.jboss.profileservice.mock.ds.FakeDataSourceDeployer">
                   <install bean="MainDeployer" method="addDeployer">
                   <parameter><this/></parameter>
                   </install>
                   <uninstall bean="MainDeployer" method="removeDeployer">
                   <parameter><this/></parameter>
                   </uninstall>
                   <property name="type">jca-ds</property>
                   <property name="propertyNameMappings">
                   <inject bean="DsPropertyMappings" />
                   </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="FakeDsXmlDataSourceTemplate"
                   class="org.jboss.profileservice.management.templates.FakeDsXmlDataSourceTemplate">
                   <install bean="ManagementView" method="addTemplate">
                   <parameter>
                   <this/>
                   </parameter>
                   </install>
                   <uninstall bean="ManagementView" method="removeTemplate">
                   <parameter>
                   <this/>
                   </parameter>
                   </uninstall>
                   <property name="info"><inject bean="FakeDsXmlDataSourceTemplateInfo"/></property>
                   <property name="deployer"><inject bean="FakeDataSourceDeployer" /></property>
                   </bean>
                  
                   <bean name="FakeDsXmlDataSourceTemplateInfo"
                   class="org.jboss.profileservice.management.templates.DsXmlDataSourceTemplateInfo">
                   <constructor>
                   <parameter>FakeDsXmlDataSourceTemplate</parameter>
                   <parameter>A template for *-dsf.xml deployments</parameter>
                   <parameter>org.jboss.system.metadata.ServiceMetaData</parameter>
                   <parameter>FakeConnectionFactoryDeployer.datasource-type</parameter>
                   </constructor>
                   <!-- Specify a mapping from service attribute names used by the datasource
                   deployment ServiceMetaData to ManagedProperty names.
                   -->
                   <property name="propertyNameMappings">
                   <inject bean="DsPropertyMappings" />
                   </property>
                   </bean>
                   <bean name="DsXmlDataSourceTemplateInfo"
                   class="org.jboss.profileservice.management.templates.DsXmlDataSourceTemplateInfo">
                   <constructor>
                   <parameter>DsXmlDataSourceTemplate</parameter>
                   <parameter>A template for *-ds.xml deployments</parameter>
                   <parameter>org.w3c.dom.Document</parameter>
                   </constructor>
                   <!-- Specify a mapping from service attribute names used by the datasource
                   deployment ServiceMetaData to ManagedProperty names.
                   -->
                   <property name="propertyNameMappings">
                   <inject bean="DsPropertyMappings" />
                   </property>
                   </bean>
                   <bean name="DsPropertyMappings" class="java.util.HashMap">
                   <constructor>
                   <map class="java.util.HashMap" keyClass="java.lang.String" valueClass="java.lang.String">
                   <entry><key>jndi-name</key><value>JndiName</value></entry>
                   <entry><key>connection-url</key><value>JdbcURL</value></entry>
                   <entry><key>user-name</key><value>Username</value></entry>
                   <entry><key>password</key><value>Password</value></entry>
                   <entry><key>driver-class</key><value>DriverClass</value></entry>
                   <entry><key>min-pool-size</key><value>MinPoolSize</value></entry>
                   <entry><key>max-pool-size</key><value>MaxPoolSize</value></entry>
                   <entry><key>security-domain</key><value>SecurityDomain</value></entry>
                   </map>
                   </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>
                   <property name="viewManager"><inject bean="ManagementView"/></property>
                   <depends>ConnectorMBean</depends>
                   </bean>
                  
                   <bean name="ComponentTypeOverridesVisitor"
                   class="org.jboss.profileservice.management.ComponentTypeOverridesVisitor">
                   </bean>
                  
                   <!-- Hotdeployment of applications -->
                   <bean name="HDScanner"
                   class="org.jboss.system.server.profileservice.hotdeploy.HDScanner">
                   <property name="mainDeployer"><inject bean="MainDeployer"/></property>
                   <!-- Workaround for JBMICROCONT-176
                   -->
                   <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
                   <!-- Broken due to JBMICROCONT-176
                   <property name="controller"><inject bean="jboss.kernel:service=Kernel" property="controller"/></property>
                   -->
                  
                   <property name="profileService"><inject bean="ProfileService"/></property>
                   <property name="scanPeriod">5000</property>
                   <property name="scanThreadName">HDScanner</property>
                   </bean>
                  </deployment>