[jboss-cvs] JBossAS SVN: r64997 - in trunk: connector/src/main/org/jboss/resource/connectionmanager and 18 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Aug 31 18:39:13 EDT 2007
Author: scott.stark at jboss.org
Date: 2007-08-31 18:39:13 -0400 (Fri, 31 Aug 2007)
New Revision: 64997
Added:
trunk/connector/src/main/org/jboss/resource/metadata/mcf/AllowedTxSupportMetaData.java
Removed:
trunk/connector/src/main/org/jboss/resource/deployers/management/ConnectionFactoryManagedObject.java
trunk/profileservice/src/main/org/jboss/profileservice/management/ComponentTypeOverridesVisitor.java
trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedComponentImpl.java
trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedDeploymentImpl.java
trunk/system/src/main/org/jboss/deployers/spi/management/ComponentType.java
trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java
trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java
trunk/system/src/main/org/jboss/deployers/spi/management/ManagedComponent.java
trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java
trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java
Modified:
trunk/connector/.classpath
trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionFactoryBindingService.java
trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java
trunk/connector/src/main/org/jboss/resource/deployers/ManagedConnectionFactoryDeployer.java
trunk/connector/src/main/org/jboss/resource/deployers/builder/ConnectionManagerBuilder.java
trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceConnectionPropertyMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/LocalDataSourceDeploymentMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentGroup.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryPropertyMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxConnectionFactoryDeploymentMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxDataSourceDeploymentMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/NonXADataSourceDeploymentMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java
trunk/connector/src/main/org/jboss/resource/metadata/mcf/XADataSourceDeploymentMetaData.java
trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
trunk/profileservice/src/main/org/jboss/profileservice/management/builders/DomDataSourceManagedObject.java
trunk/profileservice/src/main/org/jboss/profileservice/management/builders/FakeConnectionFactoryDeployerManagedObjectBuilder.java
trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ServiceManagedObject.java
trunk/profileservice/src/main/org/jboss/profileservice/mock/ds/FakeDataSourceDeployer.java
trunk/system-jmx/.classpath
trunk/system/src/main/org/jboss/deployers/spi/management/KnownComponentTypes.java
trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java
trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java
trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
Update for the management changes.
Modified: trunk/connector/.classpath
===================================================================
--- trunk/connector/.classpath 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/.classpath 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="src" path="src/tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/j2se"/>
<classpathentry kind="src" path="/profileservice"/>
@@ -36,5 +37,7 @@
<classpathentry kind="lib" path="/thirdparty/quartz/lib/quartz-all.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/integration-sources.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/main"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar" sourcepath="/thirdparty/jboss/test/lib/jboss-test-src.zip"/>
+ <classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar" sourcepath="/thirdparty/junit/lib/junit-src.zip"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionFactoryBindingService.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionFactoryBindingService.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/ConnectionFactoryBindingService.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -29,6 +29,10 @@
import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.util.naming.NonSerializableFactory;
@@ -37,8 +41,10 @@
*
* @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
* @author <a href="mailto:weston.price at jboss.com">Weston Price</a>
+ * @author Scott.Stark at jboss.org
* @version $Revision$
*/
+ at ManagementObject(isRuntime=true)
public class ConnectionFactoryBindingService extends ServiceMBeanSupport
implements ConnectionFactoryBindingServiceMBean
{
@@ -72,6 +78,7 @@
unbindConnectionFactory();
}
+ @ManagementProperty(use={ViewUse.RUNTIME})
public ObjectName getConnectionManager()
{
return cm;
@@ -82,11 +89,18 @@
this.cm = cm;
}
+ @ManagementProperty(use={ViewUse.RUNTIME})
public String getBindName()
{
return bindName;
}
+ /**
+ * The global JNDI name the factory is bound under. This is the ManagedObject
+ * id that ties the mbean to the root ManagedConnectionFactoryDeploymentMetaData
+ * based ManagedObject.
+ */
+ @ManagementObjectID(type="DataSource")
public String getJndiName()
{
return jndiName;
Modified: trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/connectionmanager/JBossManagedConnectionPool.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -39,6 +39,14 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedOperation.Impact;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementParameter;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
import org.jboss.mx.util.JMXExceptionDecoder;
import org.jboss.resource.JBossResourceException;
import org.jboss.resource.connectionmanager.InternalManagedConnectionPool.PoolParams;
@@ -68,6 +76,7 @@
*
* @version $Revision$
*/
+ at ManagementObject(isRuntime=true, properties=ManagementProperties.EXPLICIT)
public class JBossManagedConnectionPool extends ServiceMBeanSupport
implements JBossManagedConnectionPoolMBean, NotificationListener
{
@@ -93,13 +102,16 @@
*
* */
private String statisticsFormatter;
-
+ /** The mcf jndi name */
private String poolJndiName;
-
+
public JBossManagedConnectionPool()
{
}
+ @ManagementOperation(description="Obtain a formatted statistics report",
+ impact=Impact.ReadOnly,
+ params={@ManagementParameter(name="formatClassName",description="The StatisticsFormatter class name")})
public Object listFormatttedSubPoolStatistics(String formatClassName)
{
final JBossStatistics stats = (JBossStatistics)listStatistics();
@@ -121,13 +133,18 @@
return formatter.formatStatistics(stats);
}
-
- public Object listFormattedSubPoolStatistics(){
+
+ @ManagementOperation(description="Obtain a formatted statistics report",
+ impact=Impact.ReadOnly)
+ public Object listFormattedSubPoolStatistics()
+ {
Object formatted = listFormatttedSubPoolStatistics(statisticsFormatter);
return formatted;
}
+ @ManagementOperation(description="Obtain a statistics report",
+ impact=Impact.ReadOnly)
public Object listStatistics()
{
ManagedConnectionPoolStatistics stats = null;
@@ -160,21 +177,25 @@
this.managedConnectionFactoryName = newManagedConnectionFactoryName;
}
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="number of available connection")
public long getAvailableConnectionCount()
{
return (poolingStrategy == null) ? 0 : poolingStrategy.getAvailableConnectionCount();
}
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="number of maximum connections in use")
public long getMaxConnectionsInUseCount()
{
return (poolingStrategy == null) ? 0 : poolingStrategy.getMaxConnectionsInUseCount();
}
+ @ManagementProperty(use={ViewUse.STATISTIC}, description="number of connections currently in use")
public long getInUseConnectionCount ()
{
return (poolingStrategy == null) ? 0 : poolingStrategy.getInUseConnectionCount();
}
+ @ManagementProperty(use={ViewUse.STATISTIC})
public int getMinSize()
{
return poolParams.minSize;
@@ -185,6 +206,7 @@
poolParams.minSize = newMinSize;
}
+ @ManagementProperty(use={ViewUse.STATISTIC})
public int getMaxSize()
{
return poolParams.maxSize;
@@ -288,6 +310,8 @@
{
this.poolParams.useFastFail = useFastFail;
}
+ @ManagementOperation(description="Flush the connections in the pool",
+ impact=Impact.WriteOnly)
public void flush()
{
if (poolingStrategy == null)
@@ -305,16 +329,19 @@
}
}
+ @ManagementProperty(use={ViewUse.STATISTIC})
public int getConnectionCount()
{
return (poolingStrategy == null)? 0: poolingStrategy.getConnectionCount();
}
+ @ManagementProperty(use={ViewUse.STATISTIC})
public int getConnectionCreatedCount()
{
return (poolingStrategy == null)? 0: poolingStrategy.getConnectionCreatedCount();
}
+ @ManagementProperty(use={ViewUse.STATISTIC})
public int getConnectionDestroyedCount()
{
return (poolingStrategy == null)? 0: poolingStrategy.getConnectionDestroyedCount();
@@ -333,6 +360,13 @@
{
this.statisticsFormatter = statisticsFormatter;
}
+
+ /**
+ * The connection factory jndi name. This is used to tie the pool
+ * ManagedObject back to the ManagedConnectionFactoryDeploymentMetaData
+ * @return
+ */
+ @ManagementObjectID(type="DataSource")
public String getPoolJndiName()
{
return this.poolJndiName;
@@ -911,8 +945,8 @@
}
}
- public JBossStatistics listStatistics(){
-
+ public JBossStatistics listStatistics()
+ {
final ManagedConnectionPoolStatistics subPoolStats = new JBossManagedConnectionPoolStatistics(subPools.size());
subPoolStats.setBlockingTimeout(poolParams.blockingTimeout);
@@ -922,10 +956,8 @@
subPoolStats.setPrefill(poolParams.prefill);
subPoolStats.setNoTxnSeperatePool(noTxSeparatePools);
-
-
- for(Iterator iter = subPools.values().iterator(); iter.hasNext();){
-
+ for(Iterator iter = subPools.values().iterator(); iter.hasNext();)
+ {
JBossSubPoolStatistics stat = new JBossSubPoolStatistics();
SubPoolContext subContext = (SubPoolContext)iter.next();
Boolean trackByTxn = (subContext.getTrackByTx() != null) ? Boolean.TRUE : Boolean.FALSE;
@@ -937,8 +969,6 @@
stat.setMaxConnectionsInUse(internalPool.getMaxConnectionsInUseCount());
stat.setTotalBlockTime(internalPool.getTotalBlockTime());
subPoolStats.addSubPool(stat);
-
-
}
return (JBossStatistics)subPoolStats;
Modified: trunk/connector/src/main/org/jboss/resource/deployers/ManagedConnectionFactoryDeployer.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/ManagedConnectionFactoryDeployer.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/deployers/ManagedConnectionFactoryDeployer.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -29,12 +29,11 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
import org.jboss.deployers.spi.deployer.managed.ManagedObjectCreator;
-import org.jboss.deployers.spi.management.ComponentType;
import org.jboss.deployers.spi.management.KnownComponentTypes;
import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedObject;
import org.jboss.resource.deployers.builder.AbstractBuilder;
-import org.jboss.resource.deployers.management.ConnectionFactoryManagedObject;
import org.jboss.resource.metadata.mcf.LocalDataSourceDeploymentMetaData;
import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentMetaData;
@@ -54,7 +53,6 @@
*/
public class ManagedConnectionFactoryDeployer
extends AbstractSimpleRealDeployer<ManagedConnectionFactoryDeploymentGroup>
- implements ManagedObjectCreator
{
/** The repository */
private DefaultJCAMetaDataRepository repository;
@@ -85,6 +83,10 @@
public void setPropertyNameMappings(Map<String, String> mangedToMBeanNames)
{
+ propertyNameMappings.clear();
+ /*
+ propertyNameMappings.putAll(mangedToMBeanNames);
+ */
// Need to reverse the mapping
for(String key : mangedToMBeanNames.keySet())
{
@@ -166,7 +168,7 @@
if( data instanceof LocalDataSourceDeploymentMetaData )
type = KnownComponentTypes.DataSourceTypes.LocalTx.getType();
if( data instanceof NoTxDataSourceDeploymentMetaData )
- type = KnownComponentTypes.DataSourceTypes.NoTX.getType();
+ type = KnownComponentTypes.DataSourceTypes.NoTx.getType();
if( data instanceof XADataSourceDeploymentMetaData )
type = KnownComponentTypes.DataSourceTypes.XA.getType();
}
@@ -193,23 +195,4 @@
{
}
- public void build(DeploymentUnit unit, Map<String, ManagedObject> map) throws DeploymentException
- {
- String key = ManagedConnectionFactoryDeploymentGroup.class.getName();
- ManagedConnectionFactoryDeploymentGroup group = unit.getAttachment(key, ManagedConnectionFactoryDeploymentGroup.class);
- if( group == null )
- return;
-
- try
- {
- ConnectionFactoryManagedObject mo = new ConnectionFactoryManagedObject(group,
- propNames, propertyNameMappings);
- map.put(key, mo);
- }
- catch(Exception e)
- {
- throw new DeploymentException(e);
- }
- }
-
}
Modified: trunk/connector/src/main/org/jboss/resource/deployers/builder/ConnectionManagerBuilder.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/builder/ConnectionManagerBuilder.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/deployers/builder/ConnectionManagerBuilder.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -70,10 +70,10 @@
attribute = buildDependencyAttribute("TransactionManagerService", TM_JMX);
attributes.add(attribute);
- attribute = buildSimpleAttribute("LocalTransactions", String.valueOf(md.isLocalTransactions()));
+ attribute = buildSimpleAttribute("LocalTransactions", String.valueOf(md.getLocalTransactions()));
attributes.add(attribute);
- attribute = buildSimpleAttribute("TrackConnectionByTx", String.valueOf(md.isTrackConnectionByTransaction()));
+ attribute = buildSimpleAttribute("TrackConnectionByTx", String.valueOf(md.getTrackConnectionByTransaction()));
attributes.add(attribute);
if(md.getTransactionSupportMetaData().equals(ManagedConnectionFactoryTransactionSupportMetaData.XA))
Modified: trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -95,7 +95,7 @@
poolAttribute = buildSimpleAttribute("PreFill", String.valueOf(md.isPrefill()));
poolAttributes.add(poolAttribute);
- poolAttribute = buildSimpleAttribute("StrictMin", String.valueOf(md.isUseStrictMin()));
+ poolAttribute = buildSimpleAttribute("StrictMin", String.valueOf(md.getUseStrictMin()));
poolAttributes.add(poolAttribute);
poolAttribute = buildSimpleAttribute("StatisticsFormatter", md.getStatisticsFormatter());
Deleted: trunk/connector/src/main/org/jboss/resource/deployers/management/ConnectionFactoryManagedObject.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/ConnectionFactoryManagedObject.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/ConnectionFactoryManagedObject.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,178 +0,0 @@
-/*
- * 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.resource.deployers.management;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.deployers.spi.management.KnownComponentTypes;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.plugins.DefaultFieldsImpl;
-import org.jboss.managed.plugins.ManagedObjectImpl;
-import org.jboss.managed.plugins.ManagedPropertyImpl;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.reflect.plugins.ClassInfoImpl;
-import org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl;
-import org.jboss.reflect.spi.ClassInfo;
-import org.jboss.reflect.spi.FieldInfo;
-import org.jboss.resource.metadata.mcf.LocalDataSourceDeploymentMetaData;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentMetaData;
-import org.jboss.resource.metadata.mcf.NoTxConnectionFactoryDeploymentMetaData;
-import org.jboss.resource.metadata.mcf.NoTxDataSourceDeploymentMetaData;
-import org.jboss.resource.metadata.mcf.TxConnectionFactoryDeploymentMetaData;
-import org.jboss.resource.metadata.mcf.XADataSourceDeploymentMetaData;
-
-/**
- * The ManagedObject implementation for the ManagedConnectionFactoryDeploymentGroup.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class ConnectionFactoryManagedObject extends ManagedObjectImpl
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 1L;
- private Map<String, String> propertyNameMappings;
-
- /**
- * ConnectionFactoryManagedObject ctor
- * @param metaData - the attachment meta data instance to bind properties to
- * @param propNames - the meta data property names to create managed properties for.
- * @param propertyNameMappings - the external managed property name to metaData
- * property name mappings.
- */
- public ConnectionFactoryManagedObject(ManagedConnectionFactoryDeploymentGroup metaData,
- String[] propNames, Map<String, String> propertyNameMappings)
- throws Exception
- {
- this(ManagedConnectionFactoryDeploymentGroup.class.getName(), metaData,
- propNames, propertyNameMappings);
- }
- /**
- * ConnectionFactoryManagedObject ctor
- * @param attachmentName - the name of the deployment attachment.
- * @param metaData - the attachment meta data instance to bind properties to
- * @param propNames - the meta data property names to create managed properties for.
- * @param propertyNameMappings - the external managed property name to metaData
- * property name mappings.
- */
- public ConnectionFactoryManagedObject(String attachmentName,
- ManagedConnectionFactoryDeploymentGroup metaData, String[] propNames,
- Map<String, String> propertyNameMappings)
- throws Exception
- {
- super(attachmentName);
-
- this.propertyNameMappings = propertyNameMappings;
- IntrospectionTypeInfoFactoryImpl typeInfo = new IntrospectionTypeInfoFactoryImpl();
-
- // Create the ManagedPropertys for the metaData
- Set<ManagedProperty> properties = getProperties();
- List<ManagedConnectionFactoryDeploymentMetaData> deployments = metaData.getDeployments();
- // TODO: Cannot handle multiple datasource deployments
- if( deployments.size() > 1 )
- throw new IllegalStateException("TODO: Cannot support multiple ds deployments currently");
- String dsType = null;
-
- for(ManagedConnectionFactoryDeploymentMetaData md : deployments)
- {
- if( md instanceof LocalDataSourceDeploymentMetaData )
- dsType = "local-tx-datasource";
- if( md instanceof NoTxDataSourceDeploymentMetaData )
- dsType = "no-tx-datasource";
- if( md instanceof XADataSourceDeploymentMetaData )
- dsType = "xa-datasource";
- if( md instanceof NoTxConnectionFactoryDeploymentMetaData )
- dsType = "no-tx-connection-factory";
- if( md instanceof TxConnectionFactoryDeploymentMetaData )
- dsType = "tx-connection-factory";
-
- Class mdClass = md.getClass();
- ClassInfoImpl info = new ClassInfoImpl(mdClass.getName());
- info.setType(mdClass);
- info.setTypeInfoFactory(typeInfo);
- info.setClassInfoHelper(typeInfo);
- ClassInfoImpl superClazz = typeInfo.getSuperClass(info);
- info.setSuperclass(superClazz);
- for(String name : propNames)
- {
- ConnectionFactoryFields fields = createField(md, name, info);
- ConnectionFactoryProperty p = new ConnectionFactoryProperty(this, fields);
- properties.add(p);
- }
- // Handle the datasource-type
- DefaultFieldsImpl f = new DefaultFieldsImpl();
- f.setName("datasource-type");
- f.setDescription("The type of the DataSource");
- f.setMandatory(true);
- f.setValue("local-tx-datasource");
- HashSet<MetaValue> values = new HashSet<MetaValue>();
- values.add(SimpleValueSupport.wrap("local-tx-datasource"));
- values.add(SimpleValueSupport.wrap("no-tx-datasource"));
- values.add(SimpleValueSupport.wrap("xa-datasource"));
- values.add(SimpleValueSupport.wrap("no-tx-connection-factory"));
- values.add(SimpleValueSupport.wrap("tx-connection-factory"));
- f.setLegalValues(values);
- f.setMetaType(SimpleMetaType.STRING);
- ManagedPropertyImpl dsTypeProp = new ManagedPropertyImpl(this, f);
- properties.add(dsTypeProp);
- }
- }
-
- @Override
- public String toString()
- {
- StringBuilder tmp = new StringBuilder("ConnectionFactoryManagedObject{");
- tmp.append(super.getProperties());
- tmp.append('}');
- return tmp.toString();
- }
-
- /**
- *
- * @param md
- * @param name
- * @return
- * @throws Exception
- */
- ConnectionFactoryFields createField(ManagedConnectionFactoryDeploymentMetaData md, String name,
- ClassInfo info)
- throws Exception
- {
- // Transform external property names to field accessors
- String propName = propertyNameMappings.get(name);
- FieldInfo fi = null;
- ClassInfo ci = info;
- while( fi == null && ci != null )
- {
- fi = ci.getDeclaredField(name);
- ci = ci.getSuperclass();
- }
- ConnectionFactoryFields fields = new ConnectionFactoryFields(md, fi, propName);
- return fields;
- }
-}
Added: trunk/connector/src/main/org/jboss/resource/metadata/mcf/AllowedTxSupportMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/AllowedTxSupportMetaData.java (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/AllowedTxSupportMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -0,0 +1,62 @@
+/*
+ * 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.resource.metadata.mcf;
+
+import java.util.HashSet;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.managed.api.Fields;
+import org.jboss.managed.spi.factory.ManagedPropertyConstraintsPopulator;
+import org.jboss.managed.spi.factory.ManagedPropertyConstraintsPopulatorFactory;
+import org.jboss.metatype.api.types.EnumMetaType;
+import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+
+/**
+ * Contraints populator for the ManagedConnectionFactoryTransactionSupportMetaData enum
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class AllowedTxSupportMetaData implements
+ ManagedPropertyConstraintsPopulator,
+ ManagedPropertyConstraintsPopulatorFactory
+{
+ private static EnumMetaType TYPE = new EnumMetaType(ManagedConnectionFactoryTransactionSupportMetaData.values());
+ private static HashSet<MetaValue> values = new HashSet<MetaValue>();
+ static
+ {
+ values.add(new EnumValueSupport(TYPE, ManagedConnectionFactoryTransactionSupportMetaData.NONE));
+ values.add(new EnumValueSupport(TYPE, ManagedConnectionFactoryTransactionSupportMetaData.LOCAL));
+ values.add(new EnumValueSupport(TYPE, ManagedConnectionFactoryTransactionSupportMetaData.XA));
+ }
+
+ public void populateManagedProperty(Class attachmentClass, PropertyInfo info, Fields fields)
+ {
+ fields.setField(Fields.LEGAL_VALUES, values);
+ }
+
+ public ManagedPropertyConstraintsPopulator newInstance()
+ {
+ return this;
+ }
+
+}
Property changes on: trunk/connector/src/main/org/jboss/resource/metadata/mcf/AllowedTxSupportMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceConnectionPropertyMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceConnectionPropertyMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceConnectionPropertyMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -26,7 +26,10 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
/**
* A DataSourceConnectionPropertyMetaData.
*
@@ -34,6 +37,7 @@
* @version $Revision: 1.1 $
*/
@XmlAccessorType(XmlAccessType.FIELD)
+ at ManagementObject
public class DataSourceConnectionPropertyMetaData
{
@XmlAttribute(name="name")
@@ -41,7 +45,7 @@
@XmlValue
protected String value;
-
+
public String getName()
{
return name;
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/DataSourceDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -27,6 +27,8 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
/**
* A DataSourceDeploymentMetaData.
*
@@ -88,6 +90,8 @@
}
+ @ManagementProperty(name="transaction-isolation",
+ description="The DataSource transaction isolation level")
public String getTransactionIsolation()
{
return transactionIsolation;
@@ -98,11 +102,13 @@
this.transactionIsolation = transactionIsolation;
}
+ @ManagementProperty(name="connection-property", description="The DataSource connection property info", managed=true)
public List<DataSourceConnectionPropertyMetaData> getDataSourceConnectionProperties()
{
return this.connectionProperties;
}
+ @ManagementProperty(name="password", description="The DataSource password")
public String getPassWord()
{
return passWord;
@@ -113,6 +119,7 @@
this.passWord = passWord;
}
+ @ManagementProperty(name="user-name", description="The DataSource username")
public String getUserName()
{
return userName;
@@ -124,6 +131,8 @@
}
+ @ManagementProperty(name="check-valid-connection-sql",
+ description="The SQL statement to validate a connection")
public String getCheckValidConnectionSQL()
{
return checkValidConnectionSQL;
@@ -134,6 +143,8 @@
this.checkValidConnectionSQL = checkValidConnectionSQL;
}
+ @ManagementProperty(name="exception-sorter-class-name",
+ description="The exception sorter class name")
public String getExceptionSorterClassName()
{
return exceptionSorterClassName;
@@ -144,6 +155,7 @@
this.exceptionSorterClassName = exceptionSorterClassName;
}
+ @ManagementProperty(name="new-connection-sql", description="The new connection SQL")
public String getNewConnectionSQL()
{
return newConnectionSQL;
@@ -154,6 +166,7 @@
this.newConnectionSQL = newConnectionSQL;
}
+ @ManagementProperty(name="valid-connection-checker-class-name", description="The DataSource connection checker class name")
public String getValidConnectionCheckerClassName()
{
return validConnectionCheckerClassName;
@@ -164,6 +177,8 @@
this.validConnectionCheckerClassName = validConnectionCheckerClassName;
}
+ @ManagementProperty(name="prepared-statement-cache-size",
+ description="The DataSource prepared statement cache size")
public int getPreparedStatementCacheSize()
{
return preparedStatementCacheSize;
@@ -174,6 +189,7 @@
this.preparedStatementCacheSize = preparedStatementCacheSize;
}
+ @ManagementProperty(name="query-timeout", description="The query timeout")
public int getQueryTimeout()
{
return queryTimeout;
@@ -184,6 +200,7 @@
this.queryTimeout = queryTimeout;
}
+ @ManagementProperty(name="share-prepared-statements", description="Should prepared statements be shared")
public boolean isSharePreparedStatements()
{
return sharePreparedStatements;
@@ -194,6 +211,7 @@
this.sharePreparedStatements = sharePreparedStatements;
}
+ @ManagementProperty(name="track-statements", description="The query timeout")
public boolean isTrackStatements()
{
return trackStatements;
@@ -204,6 +222,7 @@
this.trackStatements = trackStatements;
}
+ @ManagementProperty(name="set-tx-query-timeout", description="Should query timeout be enabled")
public boolean isUseQueryTimeout()
{
return useQueryTimeout;
@@ -215,6 +234,7 @@
}
@Override
+ @ManagementProperty(name="config-property", description="The connection factory property info", managed=true)
public List<ManagedConnectionFactoryPropertyMetaData> getManagedConnectionFactoryProperties()
{
List<ManagedConnectionFactoryPropertyMetaData> properties = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/LocalDataSourceDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/LocalDataSourceDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/LocalDataSourceDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -25,7 +25,10 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+
/**
* A LocalDataSourceDeploymentMetaData.
*
@@ -34,6 +37,7 @@
*/
@XmlType(name="local-tx-datasource")
@XmlAccessorType(XmlAccessType.FIELD)
+ at ManagementObject(componentType=@ManagementComponent(type="DataSource",subtype="LocalTx"))
public class LocalDataSourceDeploymentMetaData extends NonXADataSourceDeploymentMetaData
{
/** The serialVersionUID */
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentGroup.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentGroup.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentGroup.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -33,15 +33,19 @@
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
import org.jboss.system.metadata.ServiceMetaData;
/**
* A ManagedConnectionFactoryDeploymentGroup.
*
* @author <a href="weston.price at jboss.org">Weston Price</a>
+ * @author Scott.Stark at jboss.org
* @version $Revision: 1.1 $
*/
@XmlAccessorType(XmlAccessType.NONE)
+ at ManagementObject
public class ManagedConnectionFactoryDeploymentGroup implements Serializable
{
/** The serialVersionUID */
@@ -69,6 +73,7 @@
this.deployments.add(deployment);
}
+ @ManagementProperty(description="The connection factories", managed=true)
public List<ManagedConnectionFactoryDeploymentMetaData> getDeployments()
{
return Collections.unmodifiableList(deployments);
@@ -79,6 +84,7 @@
*
* @return the fileUrl.
*/
+ @ManagementProperty(description="The ds.xml url")
public URL getUrl()
{
return fileUrl;
@@ -109,6 +115,7 @@
*
* @return the services.
*/
+ @ManagementProperty(description="The extra mbeans from the ds.xml", managed=true)
public List<ServiceMetaData> getServices()
{
return services;
@@ -124,5 +131,4 @@
this.services = services;
}
-
}
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -33,6 +33,12 @@
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementObjectRef;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
import org.jboss.system.metadata.ServiceMetaData;
@@ -43,7 +49,9 @@
* @version $Revision: 1.1 $
*/
@XmlAccessorType(XmlAccessType.FIELD)
-public class ManagedConnectionFactoryDeploymentMetaData implements Serializable, ConnectionPoolMetaData
+ at ManagementObject(properties=ManagementProperties.EXPLICIT)
+public class ManagedConnectionFactoryDeploymentMetaData
+ implements Serializable, ConnectionPoolMetaData
{
/** The serialVersionUID */
private static final long serialVersionUID = -4591557831734316580L;
@@ -139,6 +147,7 @@
*
* @return the connectionDefinition.
*/
+ @ManagementProperty(name="connection-definition")
public String getConnectionDefinition()
{
return connectionDefinition;
@@ -155,10 +164,12 @@
}
/**
- * Get the jndiName.
+ * Get the jndiName. This is the id for the DataSource ManagedObject.
*
* @return the jndiName.
*/
+ @ManagementProperty(name="jndi-name", description="The global JNDI name to bind the factory under")
+ @ManagementObjectID(type="DataSource")
public String getJndiName()
{
return jndiName;
@@ -179,6 +190,7 @@
*
* @return the transactionSupportMetaData.
*/
+ @ManagementProperty(ignored=true)
public ManagedConnectionFactoryTransactionSupportMetaData getTransactionSupportMetaData()
{
return transactionSupportMetaData;
@@ -199,6 +211,7 @@
*
* @return the useJavaContext.
*/
+ @ManagementProperty(name="use-java-context")
public boolean isUseJavaContext()
{
return useJavaContext;
@@ -219,6 +232,7 @@
*
* @return the managedConnectionFactoryProperties.
*/
+ @ManagementProperty(name="config-property", managed=true)
public List<ManagedConnectionFactoryPropertyMetaData> getManagedConnectionFactoryProperties()
{
return managedConnectionFactoryProperties;
@@ -240,6 +254,7 @@
*
* @return the rarName.
*/
+ @ManagementProperty(name="rar-name")
public String getRarName()
{
return rarName;
@@ -260,6 +275,7 @@
*
* @return the securityMetaData.
*/
+ @ManagementProperty(name="security-domain", managed=true)
public SecurityMetaData getSecurityMetaData()
{
return securityMetaData;
@@ -281,6 +297,7 @@
*
* @return the typeMapping.
*/
+ @ManagementProperty(name="type-mapping")
public String getTypeMapping()
{
return typeMapping;
@@ -301,6 +318,8 @@
*
* @return the jmxInvokerName.
*/
+ @ManagementProperty(name="jmx-invoker-name")
+ @ManagementObjectRef(type="JMXInvoker")
public String getJmxInvokerName()
{
return jmxInvokerName;
@@ -321,6 +340,7 @@
*
* @return the dependsNames.
*/
+ @ManagementProperty(name="depends", ignored=true)
public List<String> getDependsNames()
{
return dependsNames;
@@ -341,6 +361,7 @@
*
* @return the dependsServices.
*/
+ @ManagementProperty(name="services", ignored=true)
public List<ServiceMetaData> getDependsServices()
{
return dependsServices;
@@ -356,6 +377,7 @@
this.dependsServices = dependsServices;
}
+ @ManagementProperty(name="min-pool-size")
public void setMinSize(int minSize)
{
this.minSize = minSize;
@@ -367,6 +389,7 @@
}
+ @ManagementProperty(name="max-pool-size")
public void setMaxSize(int maxSize)
{
this.maxPoolSize = maxSize;
@@ -378,6 +401,7 @@
}
+ @ManagementProperty(name="blocking-timeout-millis")
public void setBlockingTimeoutMilliSeconds(long blockTimeout)
{
this.blockingTimeout = blockTimeout;
@@ -390,6 +414,7 @@
}
+ @ManagementProperty(name="idle-timeout-minutes")
public void setIdleTimeoutMinutes(int idleTimeout)
{
this.idleTimeout = idleTimeout;
@@ -401,6 +426,7 @@
}
+ @ManagementProperty(name="prefill")
public void setPrefill(boolean prefill)
{
this.prefill = prefill;
@@ -418,6 +444,7 @@
}
+ @ManagementProperty(name="background-validation")
public boolean isBackgroundValidation()
{
return this.backgroundValidation;
@@ -428,6 +455,7 @@
this.backgroundValidationMinutes = interval;
}
+ @ManagementProperty(name="background-validation-minutes")
public int getBackgroundValidationMinutes()
{
return this.backgroundValidationMinutes;
@@ -438,12 +466,14 @@
this.validateOnMatch = validateOnMatch;
}
+ @ManagementProperty(name="validate-on-match")
public boolean isValidateOnMatch()
{
return this.validateOnMatch;
}
+ @ManagementProperty(name="isSameRM-override-value")
public Boolean getIsSameRMOverrideValue()
{
return isSameRMOverrideValue;
@@ -454,7 +484,8 @@
this.isSameRMOverrideValue = isSameRMOverrideValue;
}
- public Boolean isTrackConnectionByTransaction()
+ @ManagementProperty(name="track-connection-by-tx")
+ public Boolean getTrackConnectionByTransaction()
{
return trackConnectionByTransaction;
}
@@ -464,7 +495,8 @@
this.trackConnectionByTransaction = trackConnectionByTransaction;
}
- public Boolean isLocalTransactions()
+ @ManagementProperty(name="local-transaction")
+ public Boolean getLocalTransactions()
{
return localTransactions;
}
@@ -474,7 +506,8 @@
this.localTransactions = localTransactions;
}
- public Boolean isUseStrictMin()
+ @ManagementProperty(name="use-strict-min")
+ public Boolean getUseStrictMin()
{
return useStrictMin;
}
@@ -484,6 +517,7 @@
this.useStrictMin = useStrictMin;
}
+ @ManagementProperty(name="statistics-formatter")
public String getStatisticsFormatter()
{
return statisticsFormatter;
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryPropertyMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryPropertyMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryPropertyMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -28,6 +28,8 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;
+import org.jboss.managed.api.annotation.ManagementObject;
+
/**
* A ManagedConnectionFactoryProperty.
*
@@ -35,6 +37,7 @@
* @version $Revision: 1.1 $
*/
@XmlAccessorType(XmlAccessType.FIELD)
+ at ManagementObject
public class ManagedConnectionFactoryPropertyMetaData implements Serializable
{
/** The serialVersionUID */
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxConnectionFactoryDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxConnectionFactoryDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxConnectionFactoryDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -23,7 +23,11 @@
import javax.xml.bind.annotation.XmlType;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
/**
* A NoTxConnectionFactoryDeploymentMetaData.
*
@@ -31,6 +35,7 @@
* @version $Revision: 1.1 $
*/
@XmlType(name="no-tx-connection-factory")
+ at ManagementObject(componentType=@ManagementComponent(type="ConnectionFactory",subtype="NoTx"))
public class NoTxConnectionFactoryDeploymentMetaData extends ManagedConnectionFactoryDeploymentMetaData
{
@@ -38,6 +43,7 @@
private static final long serialVersionUID = -8637168894246737692L;
@Override
+ @ManagementProperty(ignored=true)
public ManagedConnectionFactoryTransactionSupportMetaData getTransactionSupportMetaData()
{
return ManagedConnectionFactoryTransactionSupportMetaData.NONE;
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxDataSourceDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxDataSourceDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/NoTxDataSourceDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -23,7 +23,11 @@
import javax.xml.bind.annotation.XmlType;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
/**
* A NoTxDataSourceDeploymentMetaData.
*
@@ -31,12 +35,14 @@
* @version $Revision: 1.1 $
*/
@XmlType(name="no-tx-datasource")
+ at ManagementObject(componentType=@ManagementComponent(type="DataSource",subtype="NoTx"))
public class NoTxDataSourceDeploymentMetaData extends NonXADataSourceDeploymentMetaData
{
/** The serialVersionUID */
private static final long serialVersionUID = -5354506847562754007L;
@Override
+ @ManagementProperty(ignored=true)
public ManagedConnectionFactoryTransactionSupportMetaData getTransactionSupportMetaData()
{
return ManagedConnectionFactoryTransactionSupportMetaData.NONE;
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/NonXADataSourceDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/NonXADataSourceDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/NonXADataSourceDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -27,6 +27,10 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
/**
* Provide a common base for non xa data source deployment meta data.
*
@@ -34,6 +38,7 @@
* See also http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch7.chapt.html#ch7.jdbc.sect
*
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @author Scott.Stark at jboss.org
* @version $Revision: $
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -44,7 +49,8 @@
@XmlElement(name="connection-url", required=true)
private String connectionUrl;
-
+
+ @ManagementProperty(name="connection-url", description="The DataSource connection URL")
public String getConnectionUrl()
{
return connectionUrl;
@@ -55,6 +61,7 @@
this.connectionUrl = connectionUrl;
}
+ @ManagementProperty(name="driver-class", description="The DataSource connection driver class name")
public String getDriverClass()
{
return driverClass;
@@ -66,6 +73,7 @@
}
@Override
+ @ManagementProperty(name="config-property", description="The connection factory property info", managed=true)
public List<ManagedConnectionFactoryPropertyMetaData> getManagedConnectionFactoryProperties()
{
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -26,7 +26,11 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
/**
* A TxConnectionFactoryDeploymentMetaData.
*
@@ -35,6 +39,7 @@
*/
@XmlType(name="tx-connection-factory")
@XmlAccessorType(XmlAccessType.FIELD)
+ at ManagementObject(componentType=@ManagementComponent(type="ConnectionFactory",subtype="XA"))
public class TxConnectionFactoryDeploymentMetaData extends ManagedConnectionFactoryDeploymentMetaData
{
@@ -59,9 +64,10 @@
}
@Override
+ @ManagementProperty(ignored=true)
public ManagedConnectionFactoryTransactionSupportMetaData getTransactionSupportMetaData()
{
- return isLocalTransactions() ? ManagedConnectionFactoryTransactionSupportMetaData.LOCAL : ManagedConnectionFactoryTransactionSupportMetaData.XA;
+ return getLocalTransactions() ? ManagedConnectionFactoryTransactionSupportMetaData.LOCAL : ManagedConnectionFactoryTransactionSupportMetaData.XA;
}
}
Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/XADataSourceDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/XADataSourceDeploymentMetaData.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/XADataSourceDeploymentMetaData.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -7,7 +7,11 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
/**
* A XADataSourceDeploymentMetaData.
*
@@ -16,6 +20,7 @@
*/
@XmlType(name="xa-datasource")
@XmlAccessorType(XmlAccessType.FIELD)
+ at ManagementObject(componentType=@ManagementComponent(type="DataSource",subtype="XA"))
public class XADataSourceDeploymentMetaData extends DataSourceDeploymentMetaData
{
@@ -36,6 +41,7 @@
setTransactionSupportMetaData(ManagedConnectionFactoryTransactionSupportMetaData.XA);
}
+ @ManagementProperty(name="xa-datasource-class", description="The XADataSoure class")
public String getXaDataSourceClass()
{
return xaDataSourceClass;
@@ -46,6 +52,7 @@
this.xaDataSourceClass = xaDataSourceClass;
}
+ @ManagementProperty(name="xa-resource-timeout", description="The XADataSoure class")
public int getXaResourceTimeout()
{
return xaResourceTimeout;
@@ -57,6 +64,7 @@
}
@Override
+ @ManagementProperty(name="config-property", description="The connection factory property info", managed=true)
public List<ManagedConnectionFactoryPropertyMetaData> getManagedConnectionFactoryProperties()
{
List<ManagedConnectionFactoryPropertyMetaData> properties = super.getManagedConnectionFactoryProperties();
Deleted: trunk/profileservice/src/main/org/jboss/profileservice/management/ComponentTypeOverridesVisitor.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ComponentTypeOverridesVisitor.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ComponentTypeOverridesVisitor.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,122 +0,0 @@
-/*
- * 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;
-
-import org.jboss.deployers.spi.management.ComponentType;
-import org.jboss.deployers.spi.management.ComponentTypeVisitor;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.system.metadata.ServiceMetaData;
-
-/**
- * A ComponentTypeVisitor installed into DeployerAspects to allow for
- * a pluggable override of the ComponentType of a deployment.
- *
- * @author Scott.Stark at jboss.org
- * @author adrian at jboss.org
- * @version $Revision$
- */
-public class ComponentTypeOverridesVisitor
- implements ComponentTypeVisitor
-{
- private static Logger log = Logger.getLogger(ComponentTypeOverridesVisitor.class);
-
- public ComponentType visit(DeploymentUnit unit)
- {
- ComponentType type = unit.getAttachment(ComponentType.class);
- if( type == null )
- {
- type = determineComponentType(unit);
- }
- log.debug(unit+", type="+type);
- return type;
- }
-
- protected ComponentType determineComponentType(DeploymentUnit ctx)
- {
- ComponentType type = checkDataSource(ctx);
- if( type == null )
- type = checkFakeDataSource(ctx);
- if( type == null )
- type = checkJmsDestination(ctx);
- return type;
- }
-
- protected ComponentType checkDataSource(DeploymentUnit ctx)
- {
- ComponentType type = null;
- ServiceMetaData smd = ctx.getAttachment(ServiceMetaData.class);
- if( smd != null )
- {
- String code = smd.getCode();
- if( code.startsWith("org.jboss.resource.connectionmanager") )
- {
- String keys = smd.getObjectName().getKeyPropertyListString();
- if( keys.startsWith("service=NoTxCM"))
- type = new ComponentType("DataSource", "NoTx");
- else if( keys.startsWith("service=LocalTxCM"))
- type = new ComponentType("DataSource", "LocalTx");
- else if( keys.startsWith("service=XATxCM"))
- type = new ComponentType("DataSource", "XATx");
- }
- }
- return type;
- }
- protected ComponentType checkFakeDataSource(DeploymentUnit ctx)
- {
- ComponentType type = null;
- ServiceMetaData smd = ctx.getAttachment(ServiceMetaData.class);
- if( smd != null )
- {
- String code = smd.getCode();
- if( code.indexOf("FakeDataSourceConn") > 0 )
- type = new ComponentType("FakeDataSource", "LocalTx");
- }
- return type;
- }
-
- /**
- * Determines the jms destination based on the org.jboss.jms.server.destination.Queue
- * or org.jboss.jms.server.destination.Topic mbean in the ctx ServiceMetaData
- * attachment.
- *
- * @param ctx
- * @return The ComponentType
- */
- protected ComponentType checkJmsDestination(DeploymentUnit ctx)
- {
- ComponentType type = null;
- ServiceMetaData smd = ctx.getAttachment(ServiceMetaData.class);
- if( smd != null )
- {
- String code = smd.getCode();
- if( code.startsWith("org.jboss.jms.server.destination") )
- {
- if( code.contains(".Queue") )
- type = new ComponentType("JMSDestination", "Queue");
- else if( code.contains(".Topic") )
- type = new ComponentType("JMSDestination", "Topic");
- }
- }
- return type;
- }
-}
Deleted: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedComponentImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedComponentImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedComponentImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,74 +0,0 @@
-/*
- * 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;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import org.jboss.deployers.spi.management.ComponentType;
-import org.jboss.deployers.spi.management.ManagedComponent;
-import org.jboss.deployers.spi.management.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();
- }
-}
Deleted: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedDeploymentImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedDeploymentImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ManagedDeploymentImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,158 +0,0 @@
-/*
- * 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;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
-import org.jboss.deployers.spi.management.ManagedComponent;
-import org.jboss.deployers.spi.management.ManagedDeployment;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
-
-/**
- * @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 ArrayList<ManagedComponent> components = new ArrayList<ManagedComponent>();
- private ArrayList<ManagedDeployment> children = new ArrayList<ManagedDeployment>();
-
- ManagedDeploymentImpl(ManagementViewImpl mgtView, Deployment ctx,
- Map<String, ManagedProperty> properties)
- {
- this(mgtView, ctx, properties, null);
- }
- ManagedDeploymentImpl(ManagementViewImpl mgtView, Deployment ctx,
- Map<String, ManagedProperty> properties, ManagedDeployment parent)
- {
- super(ctx.getSimpleName(), properties);
- this.name = ctx.getName();
- // TODO this.types = ctx.getTypes();
- // TODO this.phase = ctx.getTransientManagedObjects().getAttachment(DeploymentPhase.class);
- this.parent = parent;
- }
-
-
- @Override
- public String getName()
- {
- return name;
- }
-
- public Set<String> getTypes()
- {
- return types;
- }
-
- public DeploymentPhase getDeploymentPhase()
- {
- return phase;
- }
- public ManagedDeployment getParent()
- {
- return parent;
- }
-
- public Set<String> getComponentTemplateNames()
- {
- // TODO Auto-generated method stub
- return null;
- }
- public DeploymentTemplateInfo getTemplate(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
- public ManagedComponent addComponent(DeploymentTemplateInfo info)
- {
-
- return null;
- }
-
- public List<ManagedComponent> getComponents()
- {
- return components;
- }
-
- public void removeComponent(ManagedComponent mc)
- {
- // TODO Auto-generated method stub
-
- }
-
- 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();
- }
-
-}
Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -22,11 +22,11 @@
package org.jboss.profileservice.management;
import java.io.Serializable;
+import java.lang.annotation.Annotation;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
@@ -36,30 +36,39 @@
import org.jboss.deployers.client.spi.Deployment;
import org.jboss.deployers.client.spi.main.MainDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.management.ComponentType;
-import org.jboss.deployers.spi.management.ComponentTypeListener;
-import org.jboss.deployers.spi.management.ComponentTypeVisitor;
import org.jboss.deployers.spi.management.DeploymentTemplate;
import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
-import org.jboss.deployers.spi.management.ManagedComponent;
-import org.jboss.deployers.spi.management.ManagedDeployment;
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.deployers.structure.spi.DeploymentContext;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.logging.Logger;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedOperation;
import org.jboss.managed.api.ManagedProperty;
-import org.jboss.profileservice.aop.DeployerAspects;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.api.annotation.ManagementObjectRef;
+import org.jboss.managed.plugins.ManagedComponentImpl;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.managed.plugins.factory.AbstractManagedObjectFactory;
+import org.jboss.metatype.api.types.ArrayMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.values.ArrayValue;
+import org.jboss.metatype.api.values.GenericValue;
+import org.jboss.metatype.api.values.SimpleValue;
import org.jboss.profileservice.spi.AttachmentsSerializer;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.virtual.VirtualFile;
/**
@@ -70,7 +79,7 @@
* @version $Revision$
*/
public class ManagementViewImpl
- implements ManagementView, ComponentTypeListener
+ implements ManagementView
{
private static Logger log = Logger.getLogger(ManagementViewImpl.class);
private static final String BUNDLE_NAME = "org.jboss.profileservice.management.messages"; //$NON-NLS-1$
@@ -94,14 +103,19 @@
private Locale currentLocale;
/** */
private MessageFormat formatter = new MessageFormat("");
- /** */
- private HashMap<DeploymentContext, ComponentType> ctxToCompType =
- new HashMap<DeploymentContext, ComponentType>();
/** An index of ManagedComponent by ComponentType */
private HashMap<ComponentType, Set<ManagedComponent>> compByCompType =
new HashMap<ComponentType, Set<ManagedComponent>>();
- private HashMap<DeploymentContext, ManagedDeployment> ctxToDeployment =
- new HashMap<DeploymentContext, ManagedDeployment>();
+ /** id/type key to ManagedObject map */
+ private Map<String, ManagedObject> moRegistry = new HashMap<String, ManagedObject>();
+ /** The deployment name to ManagedDeployment map */
+ private Map<String, ManagedDeployment> managedDeployments = new HashMap<String, ManagedDeployment>();
+ /** The ManagedPropertys with unresolved ManagementObjectRefs */
+ private Map<String, Set<ManagedProperty>> unresolvedRefs = new HashMap<String, Set<ManagedProperty>>();
+ /** A map of runtime ManagedObjects needing to be merged with their
+ * matching ManagedObject.
+ */
+ private Map<String, ManagedObject> runtimeMOs = new HashMap<String, ManagedObject>();
public ManagementViewImpl()
{
@@ -118,7 +132,7 @@
* @throws NoSuchProfileException
*/
public void loadProfile(ProfileKey key)
- throws NoSuchProfileException
+ throws Exception
{
activeProfile = ps.getProfile(key);
if( activeProfile == null )
@@ -128,8 +142,195 @@
String msg = formatter.format(args);
throw new NoSuchProfileException(msg);
}
+ // Process the deployments
+ Set<String> deploymentNames = activeProfile.getDeploymentNames();
+ for(String name : deploymentNames)
+ {
+ ManagedDeployment md = mainDeployer.getManagedDeployment(name);
+ log.info(name+" ManagedDeployment: " + md);
+ Map<String, ManagedObject> mos = md.getManagedObjects();
+ log.info(name+" ManagedObjects: " + mos);
+ for(ManagedObject mo : mos.values())
+ {
+ processManagedObject(mo, md);
+ }
+ managedDeployments.put(name, md);
+ }
+
}
+ /**
+ *
+ * @param mo
+ * @param md -
+ */
+ protected void processManagedObject(ManagedObject mo, ManagedDeployment md)
+ {
+ String key = mo.getName() + "/" + mo.getNameType();
+ log.debug("ID for ManagedObject: "+key+", attachmentName: "+mo.getAttachmentName());
+ // See if this is a runtime ManagedObject
+ Map<String, Annotation> moAnns = mo.getAnnotations();
+ ManagementObject managementObject = (ManagementObject) moAnns.get(ManagementObject.class.getName());
+ if (managementObject.isRuntime())
+ {
+ // Merge this with the ManagedObject
+ ManagedObject parentMO = moRegistry.get(key);
+ if (parentMO == null)
+ {
+ // Save the runtime mo for merging
+ runtimeMOs.put(key, mo);
+ return;
+ }
+ mergeRuntimeMO(parentMO, mo);
+ }
+ else
+ {
+ // See if there is runtime info to merge
+ ManagedObject runtimeMO = runtimeMOs.get(key);
+ if (runtimeMO != null)
+ mergeRuntimeMO(mo, runtimeMO);
+ }
+
+ // Update the MO registry
+ ManagedObject prevMO = moRegistry.put(key, mo);
+ if( prevMO != null )
+ log.warn("Duplicate mo for key: "+key+", prevMO: "+prevMO);
+ // Check for unresolved refs
+ checkForReferences(key, mo);
+
+ // Create ManagedComponents for
+ ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
+ if (mc != null)
+ {
+ ComponentType type = new ComponentType(mc.type(), mc.subtype());
+ ManagedComponentImpl comp = new ManagedComponentImpl(type, md, mo);
+ md.addComponent(mo.getName(), comp);
+ Set<ManagedComponent> typeComps = compByCompType.get(type);
+ if (typeComps == null)
+ {
+ typeComps = new HashSet<ManagedComponent>();
+ compByCompType.put(type, typeComps);
+ }
+ typeComps.add(comp);
+ }
+
+ // Scan for @ManagementObjectRef
+ for(ManagedProperty prop : mo.getProperties().values())
+ {
+ log.debug("Checking property: "+prop);
+ // See if this is a ManagementObjectID
+ ManagementObjectID id = (ManagementObjectID) prop.getAnnotations().get(ManagementObjectID.class.getName());
+ if (id != null)
+ {
+ SimpleValue refValue = (SimpleValue) prop.getValue();
+ String refName = (String) refValue.getValue();
+ if (refName == null)
+ refName = id.name();
+ String propKey = refName + "/" + id.type();
+ log.debug("ManagedProperty level ID for ManagedObject: "+propKey+", attachmentName: "+mo.getAttachmentName());
+ moRegistry.put(propKey, mo);
+ checkForReferences(propKey, mo);
+ }
+
+ // See if this is a ManagementObjectRef
+ ManagementObjectRef ref = (ManagementObjectRef) prop.getAnnotations().get(ManagementObjectRef.class.getName());
+ if ( ref != null )
+ {
+ // The reference key is the prop value + ref.type()
+ log.debug("Property("+prop.getName()+") references: "+ref);
+ SimpleValue refValue = (SimpleValue) prop.getValue();
+ String refName = (String) refValue.getValue();
+ if (refName == null)
+ refName = ref.name();
+ String targetKey = refName + "/" + ref.type();
+ ManagedObject target = moRegistry.get(targetKey);
+ if (target != null)
+ {
+ log.debug("Resolved property("+prop.getName()+") reference to: "+targetKey);
+ prop.setTargetManagedObject(target);
+ }
+ else
+ {
+ Set<ManagedProperty> referers = unresolvedRefs.get(targetKey);
+ if (referers == null)
+ {
+ referers = new HashSet<ManagedProperty>();
+ unresolvedRefs.put(targetKey, referers);
+ }
+ referers.add(prop);
+ }
+ }
+
+ MetaType propType = prop.getMetaType();
+ if (propType == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
+ {
+ GenericValue gv = (GenericValue) prop.getValue();
+ ManagedObject propMO = (ManagedObject) gv.getValue();
+ processManagedObject(propMO, md);
+ }
+ else if (propType.isArray())
+ {
+ ArrayMetaType amt = (ArrayMetaType) propType;
+ MetaType etype = amt.getElementType();
+ if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
+ {
+ ArrayValue<GenericValue> avalue = (ArrayValue<GenericValue>) prop.getValue();
+ for(int n = 0; n < avalue.getLength(); n ++)
+ {
+ GenericValue gv = (GenericValue) avalue.getValue(n);
+ ManagedObject propMO = (ManagedObject) gv.getValue();
+ processManagedObject(propMO, md);
+ }
+ }
+ }
+ }
+ }
+
+ public Map<String, Set<ManagedProperty>> getUnresolvedRefs()
+ {
+ return unresolvedRefs;
+ }
+
+ protected void checkForReferences(String key, ManagedObject mo)
+ {
+ Set<ManagedProperty> referers = unresolvedRefs.get(key);
+ log.debug("checkForReferences, "+key+" has referers: "+referers);
+ if (referers != null)
+ {
+ for(ManagedProperty prop : referers)
+ {
+ prop.setTargetManagedObject(mo);
+ }
+ unresolvedRefs.remove(key);
+ }
+ }
+
+ /**
+ * Merge the runtime props and ops
+ * TODO: need a plugin to access the ManagedObject impl
+ * @param mo
+ * @param runtimeMO
+ */
+ protected void mergeRuntimeMO(ManagedObject mo, ManagedObject runtimeMO)
+ {
+ Map<String, ManagedProperty> moProps = mo.getProperties();
+ Set<ManagedOperation> moOps = mo.getOperations();
+ HashMap<String, ManagedProperty> props = new HashMap<String, ManagedProperty>(moProps);
+ HashSet<ManagedOperation> ops = new HashSet<ManagedOperation>(moOps);
+
+ Map<String, ManagedProperty> runtimeProps = runtimeMO.getProperties();
+ Set<ManagedOperation> runtimeOps = runtimeMO.getOperations();
+
+ if (runtimeProps != null)
+ props.putAll(runtimeProps);
+ if (runtimeOps != null)
+ ops.addAll(runtimeOps);
+
+ ManagedObjectImpl moi = (ManagedObjectImpl) mo;
+ moi.setProperties(props);
+ moi.setOperations(ops);
+ }
+
public ProfileService getProfileService()
{
return ps;
@@ -148,7 +349,6 @@
public void setSerializer(AttachmentsSerializer serializer)
{
this.serializer = serializer;
- DeployerAspects.setAttachmentsSerializer(serializer);
}
public MainDeployer getMainDeployer()
@@ -161,16 +361,6 @@
log.debug("setMainDeployer: "+mainDeployer);
}
- public ComponentTypeVisitor getCompVisitor()
- {
- return DeployerAspects.getCompVisitor();
- }
- public void setCompVisitor(ComponentTypeVisitor compVisitor)
- {
- DeployerAspects.setCompVisitor(compVisitor);
- DeployerAspects.setCompListener(this);
- }
-
public String getName()
{
return this.getClass().getName();
@@ -282,12 +472,6 @@
public Set<ManagedComponent> getComponentsForType(ComponentType type)
throws Exception
{
- if( compByCompType.size() == 0 )
- {
- // index the component types
- indexComponents();
- }
-
Set<ManagedComponent> mcs = compByCompType.get(type);
return mcs;
}
@@ -486,81 +670,12 @@
}
}
- /**
- * Go through the profile deployments and build ManagedDeployments
- * @throws Exception
- */
- private void indexComponents()
- throws Exception
- {
- Collection<VFSDeployment> ctxs = activeProfile.getDeployments();
- for(Deployment ctx : ctxs)
- {
- ManagedDeployment md = getManagedDeployment(ctx);
- indexComponents(md);
- }
- }
-
- private void indexComponents(ManagedDeployment md)
- {
- List<ManagedComponent> mcs = md.getComponents();
- for(ManagedComponent mc : mcs)
- {
- ComponentType type = mc.getType();
- Set<ManagedComponent> mcsForType = compByCompType.get(type);
- if( mcsForType == null )
- {
- mcsForType = new HashSet<ManagedComponent>();
- compByCompType.put(type, mcsForType);
- }
- mcsForType.add(mc);
- }
- //
- List<ManagedDeployment> children = md.getChildren();
- for(ManagedDeployment child : children)
- {
- indexComponents(child);
- }
- }
-
private ManagedDeployment getManagedDeployment(Deployment ctx)
throws Exception
{
- Map<String, ManagedObject> mdMOs = mainDeployer.getManagedObjects(ctx.getName());
- Map<String, ManagedProperty> mdProps = getProperties(mdMOs);
- ManagedDeploymentImpl md = new ManagedDeploymentImpl(this, ctx, mdProps);
- log.debug("Created "+md);
- /** TODO children
- Set<DeploymentContext> children = ctx.getChildren();
- for(DeploymentContext child : children)
- {
- Map<String, ManagedObject> childMOs = mainDeployer.getManagedObjects(ctx);
- Map<String, ManagedProperty> childProps = getProperties(childMOs);
- ManagedDeploymentImpl childMD = new ManagedDeploymentImpl(this, child, childProps, md);
- md.getChildren().add(childMD);
- getManagedComponents(child, childMD);
- }
- getManagedComponents(ctx, md);
- */
+ ManagedDeployment md = mainDeployer.getManagedDeployment(ctx.getName());
return md;
}
- /* TODO children
- private void getManagedComponents(DeploymentContext ctx, ManagedDeploymentImpl md)
- throws Exception
- {
- // Build ManagedComponents for the md
- Set<DeploymentContext> comps = ctx.getComponents();
- for(DeploymentContext comp : comps)
- {
- Map<String, ManagedObject> compMOs = mainDeployer.getManagedObjects(comp);
- Map<String, ManagedProperty> compProps = getProperties(compMOs);
- ComponentType type = ctxToCompType.get(comp);
- ManagedComponentImpl mc = new ManagedComponentImpl(comp.getSimpleName(), type, compProps, md);
- log.debug("Created "+mc);
- md.getComponents().add(mc);
- }
- }
- */
/**
* Get the map of the ManagedPropertys keyed by the property mapped name.
@@ -575,7 +690,7 @@
HashMap<String, ManagedProperty> props = new HashMap<String, ManagedProperty>();
for(ManagedObject mo : mos.values())
{
- Set<ManagedProperty> moProps = mo.getProperties();
+ Collection<ManagedProperty> moProps = mo.getProperties().values();
for(ManagedProperty prop : moProps)
{
// Use the mapped name if it exists
@@ -588,18 +703,4 @@
return props;
}
- /**
- * Check whether the deployment processing was complete
- *
- * @throws DeploymentException the deployment exception
- */
- protected void checkIncomplete() throws DeploymentException
- {
- /** TODO This should now be done by the main deployer
- IncompleteDeployments incomplete = IncompleteDeploymentsBuilder.build(mainDeployer, null);
- if (incomplete.isIncomplete())
- throw new IncompleteDeploymentException(incomplete);
- */
- }
-
}
Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/builders/DomDataSourceManagedObject.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/builders/DomDataSourceManagedObject.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/builders/DomDataSourceManagedObject.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -21,6 +21,7 @@
*/
package org.jboss.profileservice.management.builders;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -122,7 +123,7 @@
}
}
- Set<ManagedProperty> properties = getProperties();
+ Collection<ManagedProperty> properties = getProperties().values();
// The datasource-type, TODO this needs different handling since this maps to a element name, not a value
DomFields dsType = new DomFields(element, "datasource-type");
dsType.setField(Fields.DESCRIPTION, "The type of DataSource");
Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/builders/FakeConnectionFactoryDeployerManagedObjectBuilder.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/builders/FakeConnectionFactoryDeployerManagedObjectBuilder.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/builders/FakeConnectionFactoryDeployerManagedObjectBuilder.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -107,7 +107,7 @@
f21.setLegalValues(values);
f21.setMetaType(SimpleMetaType.STRING);
ManagedPropertyImpl dsType = new ManagedPropertyImpl(typeMO, f21);
- typeMO.getProperties().add(dsType);
+ typeMO.getProperties().put("datasource-type", dsType);
wrapMO = WrapperAdvice.wrapManagedObject(typeMO);
map.put(attachName, wrapMO);
}
Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ServiceManagedObject.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ServiceManagedObject.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/builders/ServiceManagedObject.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -21,6 +21,7 @@
*/
package org.jboss.profileservice.management.builders;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -70,7 +71,7 @@
super(attachmentName);
try
{
- Set<ManagedProperty> properties = getProperties();
+ Collection<ManagedProperty> properties = getProperties().values();
List<ServiceAttributeMetaData> attributes = metaData.getAttributes();
for(ServiceAttributeMetaData attr : attributes)
{
Modified: trunk/profileservice/src/main/org/jboss/profileservice/mock/ds/FakeDataSourceDeployer.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/mock/ds/FakeDataSourceDeployer.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/profileservice/src/main/org/jboss/profileservice/mock/ds/FakeDataSourceDeployer.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -32,10 +32,10 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.managed.ManagedObjectCreator;
-import org.jboss.deployers.spi.management.ComponentType;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.deployer.JAXPDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.plugins.DefaultFieldsImpl;
import org.jboss.managed.plugins.ManagedObjectImpl;
@@ -127,7 +127,7 @@
f21.setLegalValues(values);
f21.setMetaType(SimpleMetaType.STRING);
ManagedPropertyImpl dsType = new ManagedPropertyImpl(typeMO, f21);
- typeMO.getProperties().add(dsType);
+ typeMO.getProperties().put("datasource-type", dsType);
wrapMO = WrapperAdvice.wrapManagedObject(typeMO);
map.put(attachName, wrapMO);
}
Deleted: trunk/system/src/main/org/jboss/deployers/spi/management/ComponentType.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ComponentType.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ComponentType.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,127 +0,0 @@
-/*
- * 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.deployers.spi.management;
-
-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();
- }
-}
Deleted: trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeListener.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,35 +0,0 @@
-/*
- * 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.deployers.spi.management;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- * Callback interface for deployment ComponentType identification.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface ComponentTypeListener
-{
- public void updateComponentType(DeploymentUnit unit, ComponentType type);
-}
Deleted: trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ComponentTypeVisitor.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,35 +0,0 @@
-/*
- * 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.deployers.spi.management;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- * Visitor api for determining the ComponentType of a deployment.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface ComponentTypeVisitor
-{
- public ComponentType visit(DeploymentUnit unit);
-}
Modified: trunk/system/src/main/org/jboss/deployers/spi/management/KnownComponentTypes.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/KnownComponentTypes.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/KnownComponentTypes.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -21,6 +21,8 @@
*/
package org.jboss.deployers.spi.management;
+import org.jboss.managed.api.ComponentType;
+
/**
* A collection of enums for the well known component types.
*
@@ -34,7 +36,7 @@
*/
public enum DataSourceTypes
{
- XA("DataSource", "XA"), LocalTx("DataSource", "LocalTx"), NoTX("DataSource", "NoTX");
+ XA("DataSource", "XA"), LocalTx("DataSource", "LocalTx"), NoTx("DataSource", "NoTx");
private final String type;
private final String subtype;
Deleted: trunk/system/src/main/org/jboss/deployers/spi/management/ManagedComponent.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ManagedComponent.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ManagedComponent.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,73 +0,0 @@
-/*
- * 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.deployers.spi.management;
-
-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();
-}
Deleted: trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ManagedDeployment.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,126 +0,0 @@
-/*
- * 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.deployers.spi.management;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
-
-/**
- * A collection of ManagedComponent and structural information
- * about a deployment.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface ManagedDeployment
-{
- /**
- * 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();
- /**
- * Get the deployment/module types.
- * @return deployment types
- */
- public Set<String> getTypes();
- /**
- * 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();
-
- /**
- * Get the ManagedComponents for the deployment module.
- * @return ManagedComponents for the deployment module.
- */
- public List<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();
- public DeploymentTemplateInfo getTemplate(String name);
- /**
- * Add a component to this deployment
- * @param info
- * @return the component
- */
- public ManagedComponent addComponent(DeploymentTemplateInfo info);
- public void removeComponent(ManagedComponent mc);
-
- /**
- * 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);
-}
Modified: trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/ManagementView.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -24,10 +24,13 @@
import java.util.Set;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
/**
* The management view plugin spi for querying profiles for the
@@ -46,7 +49,7 @@
* @throws NoSuchProfileException
*/
public void loadProfile(ProfileKey key)
- throws NoSuchProfileException;
+ throws Exception;
/**
* Get the names of the deployment in the profile.
Deleted: trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/profileservice/aop/DeployerAspects.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -1,224 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, Red Hat Middleware LLC, and individual contributors
-* as indicated by the @author tags. See the copyright.txt file 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.aop;
-
-import java.util.Map;
-
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.deployers.spi.deployer.Deployer;
-import org.jboss.deployers.spi.management.ComponentType;
-import org.jboss.deployers.spi.management.ComponentTypeListener;
-import org.jboss.deployers.spi.management.ComponentTypeVisitor;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.logging.Logger;
-import org.jboss.profileservice.spi.AttachmentsSerializer;
-
-/**
- * Aspects that integrate with the profile service.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision: 1.1 $
- */
-public class DeployerAspects
-{
- private static Logger log = Logger.getLogger(DeployerAspects.class);
-
- /** TODO: static as a hack due to issues with aop in the bootstrap
- */
- private static ComponentTypeVisitor compVisitor;
- private static ComponentTypeListener compListener;
- private static AttachmentsSerializer attachmentsSerializer;
- private static boolean trace = true;
-
- public static ComponentTypeVisitor getCompVisitor()
- {
- return compVisitor;
- }
-
- /**
- * Set the ComponentTypeVisitor
- *
- * @param compVisitor the visitor
- */
- public static void setCompVisitor(ComponentTypeVisitor compVisitor)
- {
- DeployerAspects.compVisitor = compVisitor;
- }
-
- public static ComponentTypeListener getCompListener()
- {
- return compListener;
- }
- public static void setCompListener(ComponentTypeListener compListener)
- {
- DeployerAspects.compListener = compListener;
- }
-
- public static AttachmentsSerializer getAttachmentsSerializer()
- {
- return attachmentsSerializer;
- }
- public static void setAttachmentsSerializer(
- AttachmentsSerializer attachmentsSerializer)
- {
- DeployerAspects.attachmentsSerializer = attachmentsSerializer;
- }
- public String getName()
- {
- return this.getClass().getName();
- }
-
- public Object invoke(Invocation invocation) throws Throwable
- {
- if( trace )
- log.trace(invocation);
- MethodInvocation mi = (MethodInvocation) invocation;
- String methodName = mi.getMethod().getName();
- Object value = null;
- if( methodName.equals("prepareDeploy") )
- value = prepareDeploy(mi);
- else if( methodName.equals("commitDeploy") )
- value = commitDeploy(mi);
- else if( methodName.equals("prepareUndeploy") )
- value = prepareUndeploy(mi);
- else if( methodName.equals("commitUndeploy") )
- value = commitUndeploy(mi);
- else
- value = invocation.invokeNext();
- return value;
- }
-
- /**
- *
- * @param invocation
- * @return the result
- * @throws Throwable
- */
- public Object prepareDeploy(MethodInvocation invocation)
- throws Throwable
- {
- Deployer target = Deployer.class.cast(invocation.getTargetObject());
- Object[] args = invocation.getArguments();
- DeploymentUnit unit = DeploymentUnit.class.cast(args[0]);
- if( trace )
- log.trace("prepareDeploy, target="+target+", unit="+unit.getSimpleName());
- if( attachmentsSerializer != null )
- {
- ClassLoader loader = null;
- try
- {
- loader = unit.getClassLoader();
- }
- catch(Exception ignore)
- {
- }
- ClassLoader prevTCL = Thread.currentThread().getContextClassLoader();
- if( loader == null )
- loader = prevTCL;
- // No guarentee this is unique
- String deployerID = target.getClass().getSimpleName();
- try
- {
- Map<String, Object> map = attachmentsSerializer.loadAttachments(unit, deployerID, loader);
- if( map != null )
- {
- if( unit.getSimpleName().equals("hsqldb-ds.xml") )
- log.info("Loading hsqldb-ds.xml attachments, "+deployerID);
- /** TODO what is this doing?
- for(String key : map.keySet())
- {
- Object value = map.get(key);
- DeploymentContext ctx = unit.getDeploymentContext();
- ctx.getPredeterminedManagedObjects().addAttachment(key, value);
- }
- */
- }
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevTCL);
- }
- }
- return invocation.invokeNext();
- }
- public Object commitDeploy(MethodInvocation invocation)
- throws Throwable
- {
- Object value = invocation.invokeNext();
- Object[] args = invocation.getArguments();
- Deployer target = Deployer.class.cast(invocation.getTargetObject());
- DeploymentUnit unit = DeploymentUnit.class.cast(args[0]);
- if( trace )
- log.trace("commitDeploy, target="+target+", unit="+unit.getSimpleName());
- if( compVisitor != null )
- {
- ComponentType type = compVisitor.visit(unit);
- if( type != null && compListener != null )
- compListener.updateComponentType(unit, type);
- }
- if( attachmentsSerializer != null )
- {
- ClassLoader loader = null;
- try
- {
- loader = unit.getClassLoader();
- }
- catch(Exception ignore)
- {
- }
- ClassLoader prevTCL = Thread.currentThread().getContextClassLoader();
- if( loader == null )
- loader = prevTCL;
- // No guarentee this is unique
- String deployerID = target.getClass().getSimpleName();
- try
- {
- attachmentsSerializer.saveAttachments(unit, deployerID, loader);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevTCL);
- }
- }
- return value;
- }
-
- public Object prepareUndeploy(MethodInvocation invocation)
- throws Throwable
- {
- Object target = invocation.getTargetObject();
- if( trace )
- log.trace("prepareUndeploy, target="+target);
- return invocation.invokeNext();
- }
- public Object commitUndeploy(MethodInvocation invocation)
- throws Throwable
- {
- Object target = invocation.getTargetObject();
- Object value = invocation.invokeNext();
- if( trace )
- log.trace("commitUndeploy, target="+target);
- return value;
- }
-
-}
Modified: trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -29,7 +29,7 @@
import org.jboss.deployers.spi.attachments.Attachments;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
/**
* An interface for managing the contents of a Profile.
Modified: trunk/system/src/main/org/jboss/profileservice/spi/Profile.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/Profile.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/profileservice/spi/Profile.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -26,6 +26,7 @@
import java.util.Set;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.virtual.VirtualFile;
/**
@@ -37,16 +38,6 @@
*/
public interface Profile
{
- /** 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 key used to create the Profile
* @return the key used to create the Profile
Modified: trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/ProfileImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -34,6 +34,7 @@
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.jboss.profileservice.spi.Profile;
Modified: trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/ProfileImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -28,6 +28,7 @@
import java.util.Set;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.DeploymentRepository;
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.NoSuchDeploymentException;
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -33,10 +33,10 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.system.server.Server;
/**
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSBootstrapScannerImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -22,8 +22,8 @@
package org.jboss.system.server.profileservice;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.virtual.VirtualFile;
/**
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeployerScannerImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -22,8 +22,8 @@
package org.jboss.system.server.profileservice;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.virtual.VirtualFile;
/**
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSDeploymentScannerImpl.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -22,8 +22,8 @@
package org.jboss.system.server.profileservice;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.virtual.VirtualFile;
/**
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -34,12 +34,11 @@
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
-
/**
* A DeploymentScanner built on the ProfileService and MainDeployer. This
* is really just a simple ExecutorService Runnable that knows nothing
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -42,6 +42,7 @@
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.AttachmentsSerializer;
import org.jboss.profileservice.spi.DeploymentRepository;
import org.jboss.profileservice.spi.ModificationInfo;
@@ -49,7 +50,6 @@
import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ModificationInfo.ModifyStatus;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.util.file.Files;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
Modified: trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
===================================================================
--- trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -33,10 +33,10 @@
import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.system.server.ServerConfig;
import org.jboss.test.BaseTestCase;
import org.jboss.virtual.VFS;
Modified: trunk/system-jmx/.classpath
===================================================================
--- trunk/system-jmx/.classpath 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/system-jmx/.classpath 2007-08-31 22:39:13 UTC (rev 64997)
@@ -36,5 +36,7 @@
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-impl-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/integration/lib/jboss-integration.jar" sourcepath="/thirdparty/jboss/integration/lib/jboss-integration-sources.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/main"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-managed.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-managed-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-metatype.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-metatype-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2007-08-31 22:23:39 UTC (rev 64996)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2007-08-31 22:39:13 UTC (rev 64997)
@@ -30,12 +30,13 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.deployers.spi.management.ComponentType;
import org.jboss.deployers.spi.management.DeploymentTemplateInfo;
-import org.jboss.deployers.spi.management.ManagedComponent;
-import org.jboss.deployers.spi.management.ManagedDeployment;
import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
import org.jboss.metatype.api.types.CompositeMetaType;
import org.jboss.metatype.api.values.CompositeValueSupport;
import org.jboss.metatype.api.values.MetaValue;
@@ -43,7 +44,6 @@
import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.profileservice.spi.Profile.DeploymentPhase;
import org.jboss.test.JBossTestCase;
/** Test of using ProfileService
@@ -166,7 +166,7 @@
if (componentName.equals(comp.getName()))
{
ManagedDeployment deployment = comp.getDeployment();
- deployment.removeComponent(comp);
+ deployment.removeComponent(componentName);
break;
}
}
More information about the jboss-cvs-commits
mailing list