[teiid-commits] teiid SVN: r763 - branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Apr 13 09:25:55 EDT 2009


Author: vhalbert at redhat.com
Date: 2009-04-13 09:25:55 -0400 (Mon, 13 Apr 2009)
New Revision: 763

Removed:
   branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/LockedConfigurationID.java
   branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java
   branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java
Log:
Teiid 323 - refactured, removing unused Config API classes:  ProductType, ProductTypeID and ConfigurationLock

Deleted: branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/LockedConfigurationID.java
===================================================================
--- branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/LockedConfigurationID.java	2009-04-13 01:32:50 UTC (rev 762)
+++ branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/LockedConfigurationID.java	2009-04-13 13:25:55 UTC (rev 763)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.config.api;
-
-import java.util.Date;
-
-/**
- * This class acts as a wrapper around a single ConfigurationID, denoting that ID
- * as being locked.  However, this lock wrapper, since it extends ConfigurationID,
- * can be treated like a ConfigurationID.  In other words, this class uses the
- * Decorator pattern to add a locked attribute to any ConfigurationID instance.
- */
-public class LockedConfigurationID extends ConfigurationID{
-
-    private ConfigurationID originalID;
-    private String version;
-    private String lockHolder;
-    private long lockAcquiredAt;
-
-	/**
-     * Create a locked wrapper around the specified MetadataID instance.
-     * @param configrationName is the configuration that is to be locked.
-     * @param versionName along with configurationName uniquely identifies the configuration
-     * @throws IllegalArgumentException if the ID is null
-     */
-	public LockedConfigurationID( ConfigurationID id, String versionName, String lockHolder, long lockAcquiredAt ){
-        // The following allows this class to NOT overload and forward
-        // most methods, but does make a copy of the full name.
-        super( ((id!=null)?id.getFullName():"")); //$NON-NLS-1$
- 		if ( id == null || versionName == null || lockHolder == null ) {
-			throw new IllegalArgumentException("A null parameter has been passed when identifying a locked configuration"); //$NON-NLS-1$
-		}
-		this.originalID = id;
-        this.version = versionName;
-        this.lockHolder = lockHolder;
-        this.lockAcquiredAt = lockAcquiredAt;
-
-    }
-
-    public ConfigurationID getOriginalID() {
-        return originalID;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public String getLockHolder() {
-        return lockHolder;
-    }
-
-    public long getTimeOfAcquisitionAsLong() {
-        return lockAcquiredAt;
-    }
-
-    public Date getTimeOfAcquisition() {
-        return new Date(lockAcquiredAt);
-    }
-
-    /**
-     * Compares this object to another. If the specified object is an instance of
-     * the same class, then this method compares the name; otherwise, it throws a
-     * ClassCastException (as instances are comparable only to instances of the same
-     * class).  Note:  this method is consistent with <code>equals()</code>.
-     * <p>
-     * @param obj the object that this instance is to be compared to.
-     * @return a negative integer, zero, or a positive integer as this object
-     *      is less than, equal to, or greater than the specified object, respectively.
-     * @throws IllegalArgumentException if the specified object reference is null
-     * @throws ClassCastException if the specified object's type prevents it
-     *      from being compared to this instance.
-     */
-    public int compareTo(Object obj) {
-        return this.originalID.compareTo(obj);
-    }
-
-    /**
-     * Returns true if the specified object is semantically equal to this instance.
-     * Note:  this method is consistent with <code>compareTo()</code>.
-     * <p>
-     * @param obj the object that this instance is to be compared to.
-     * @return whether the object is equal to this object.
-     */
-    public boolean equals(Object obj) {
-            // Check if instances are identical ...
-        if (this == obj) {
-            return true;
-        }
-        return this.originalID.equals(obj);
-    }
-    /**
-     * Return a deep cloned instance of this object.  Subclasses must override
-     * this method.
-     * @return the object that is the clone of this instance.
-     * @throws CloneNotSupportedException if this object cannot be cloned (i.e., only objects in
-     * {@link com.metamatrix.metadata.api.Defaults Defaults} cannot be cloned).
-     */
-    public synchronized Object clone() throws CloneNotSupportedException {
-        Object result = null;
-        try {
-            result = new LockedConfigurationID(this.originalID, this.version, this.lockHolder, this.lockAcquiredAt );
-        } catch ( Exception e ) {
-        }
-        return result;
-    }
-}
-

Deleted: branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java
===================================================================
--- branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java	2009-04-13 01:32:50 UTC (rev 762)
+++ branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductType.java	2009-04-13 13:25:55 UTC (rev 763)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.config.api;
-
-import java.util.Collection;
-
-
-/**
- * <p>A Product, in this context, is simply a named collection of
- * Service types.  For example, the MetaMatrix Server product has
- * these service types: Query service, Transaction service, and
- * RuntimeMetadata service.</p>
- *
- * <p>A Product is a ComponentType subclass; it is a ComponentType, but
- * has references to other ComponentTypes (specifically, ComponentTypes
- * representing types of services).  Since it is a ComponentType, it
- * can be thought of as representing a type of Product (either Platform,
- * MetaData Server, or MetaMatrix Server).</p>
- * 
- * <p><b>Note:</b> Product type names where moved to 
- * {@link com.metamatrix.core.util.MetaMatrixProductVersion} in
- * version 5.0 so that other classes that don't have a dependency on
- * com.metamatrix.common can reference them.</p>
- */
-public interface ProductType extends ComponentType {
-    public static final String COMPONENT_TYPE_NAME = "Product"; //$NON-NLS-1$
-    
-    public static final ComponentTypeID PRODUCT_TYPE_ID = new ComponentTypeID(COMPONENT_TYPE_NAME);
-    public static final ComponentTypeID PRODUCT_SUPER_TYPE_ID = new ComponentTypeID(COMPONENT_TYPE_NAME);
-    
-
-    /**
-     * Returns a Collection of ComponentTypeID objects, each representing
-     * a type of service that this Product is comprised of
-     * @return Collection of ComponentTypeID objects
-     */
-    Collection getComponentTypeIDs();
-
-
-    /**
-     * Returns true if thie component type is contained in
-     * this instance of the product type.
-     * @param componentTypeID is the id of the component type to check for.
-     * @return boolean is true if the component type is contained in the product type
-     */
-    boolean contains(ComponentTypeID componentTypeID);
-}
-

Deleted: branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java
===================================================================
--- branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java	2009-04-13 01:32:50 UTC (rev 762)
+++ branches/remove_psc/common-internal/src/main/java/com/metamatrix/common/config/api/ProductTypeID.java	2009-04-13 13:25:55 UTC (rev 763)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library 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 library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.config.api;
-
-
-public class ProductTypeID extends ComponentTypeID  {
-	 public static final ProductTypeID PRODUCT_TYPE_ID = new ProductTypeID(ProductType.COMPONENT_TYPE_NAME);      
-
-//    /**
-//     * This is a Collection of all known type names of
-//     * products - it is needed by the JDBC spi impl and is
-//     * not really intended for public use.  (In other words,
-//     * it is a hack!)
-//     */
-//    public static final Collection ALL_PRODUCT_TYPES;
-//
-//
-//
-//    static{
-//        ALL_PRODUCT_TYPES = new ArrayList(3);
-//        ALL_PRODUCT_TYPES.add(ProductType.PLATFORM_TYPE_NAME);
-//        ALL_PRODUCT_TYPES.add(ProductType.METAMATRIX_SERVER_TYPE_NAME);
-//        ALL_PRODUCT_TYPES.add(ProductType.METADATA_SERVER_TYPE_NAME);
-//        ALL_PRODUCT_TYPES.add(ProductType.CONNECTOR_PRODUCT_TYPE_NAME);
-//
-//    }
-//
-
-
-
-
-    public ProductTypeID(String fullName) {
-        super(fullName);
-    }
-}
-
-
-
-
-




More information about the teiid-commits mailing list