[jboss-svn-commits] JBoss Common SVN: r3660 - in shrinkwrap/trunk: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 11 05:01:29 EST 2009
Author: aslak
Date: 2009-11-11 05:01:28 -0500 (Wed, 11 Nov 2009)
New Revision: 3660
Removed:
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ArchiveFactory.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/EnterpriseArchiveFactory.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/FactoryUtil.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/JavaArchiveFactory.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ResourceAdapterArchiveFactory.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/WebArchiveFactory.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveFactoryImpl.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveFactoryImpl.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/ResourceAdapterArchiveFactoryImpl.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveFactoryImpl.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/EnterpriseArchiveFactoryTestCase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/JavaArchiveFactoryTestCase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/ResourceAdapterArchiveFactoryTestCase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/WebArchiveFactoryTestCase.java
Log:
SHRINKWRAP-68 Removed old archive factories, replaced by SHRINKWRAP-50
Deleted: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ArchiveFactory.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ArchiveFactory.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ArchiveFactory.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.api.spec;
-
-import org.jboss.shrinkwrap.api.Archive;
-
-/**
- * ArchiveFactory
- *
- * Template Factory used to create {@link Archive} instances.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-abstract class ArchiveFactory<T extends Archive<T>>
-{
-
- //-------------------------------------------------------------------------------------||
- // Class Methods ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Create an instance of an ArchiveFactory implementation
- *
- * @return ArchiveFactory instance
- */
- protected synchronized static <T extends Archive<T>, F extends ArchiveFactory<T>> F createInstance(
- Class<F> factoryBaseType, String fqFactoryName)
- {
- try
- {
- // Create the instance
- F instance = FactoryUtil.createInstance(fqFactoryName, factoryBaseType);
-
- // Return the instance
- return instance;
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Make sure you have the impl classes on your runtime classpath", e);
- }
- }
-
- //-------------------------------------------------------------------------------------||
- // Contracts --------------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Template create method for concrete implementations
- *
- * @param archiveName
- * @return Archive instance
- */
- protected abstract T doCreate(String archiveName);
-}
Deleted: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/EnterpriseArchiveFactory.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/EnterpriseArchiveFactory.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/EnterpriseArchiveFactory.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.api.spec;
-
-
-/**
- * EnterpriseArchiveFactory
- *
- * Factory used to create {@link EnterpriseArchive} instances.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public abstract class EnterpriseArchiveFactory extends ArchiveFactory<EnterpriseArchive>
-{
-
- //-------------------------------------------------------------------------------------||
- // Class Members ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Implementation type as a FQN to avoid direct compile-time dependency
- */
- private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.spec.EnterpriseArchiveFactoryImpl";
-
- /**
- * Instance of EnterpriseArchiveFactory implementation
- */
- private static EnterpriseArchiveFactory instance;
-
- //-------------------------------------------------------------------------------------||
- // Class Methods ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Creates a {@link EnterpriseArchive} instance with the provided name.
- *
- * @param archiveName
- * @return EnterpriseArchive instance
- * @throws IllegalArgumentException if the archiveName is not present
- */
- public static EnterpriseArchive create(String archiveName)
- {
- return getInstance().doCreate(archiveName);
- }
-
- /**
- * Return instance of the EnterpriseArchiveFactory
- *
- * @return
- */
- private synchronized static EnterpriseArchiveFactory getInstance()
- {
- if (instance == null)
- {
- instance = createInstance(EnterpriseArchiveFactory.class, IMPL_TYPE);
- }
- return instance;
- }
-
-}
Deleted: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/FactoryUtil.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/FactoryUtil.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/FactoryUtil.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,106 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.api.spec;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.logging.Logger;
-
-/**
- * FactoryUtil
- *
- * Package-private factory utilities
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- * @version $Revision: $
- */
-class FactoryUtil
-{
-
- //-------------------------------------------------------------------------------------||
- // Class Members ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Logger
- */
- private static final Logger log = Logger.getLogger(FactoryUtil.class.getName());
-
- //-------------------------------------------------------------------------------------||
- // Constructor ------------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Prohibit instantiation
- */
- private FactoryUtil()
- {
- throw new UnsupportedOperationException("No instances should be created; stateless utility class");
- }
-
- //-------------------------------------------------------------------------------------||
- // Functional Methods -----------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Create an instance of the Class with the specified FQN, of the expected
- * type
- *
- * @throws IllegalArgumentException If the specified type is not assignable to the instance
- * of the class created from the specified class name, or if either argument is not
- * supplied
- */
- static <T> T createInstance(final String className, final Class<T> type) throws IllegalArgumentException
- {
- // Precondition checks
- if (className == null || className.length() == 0)
- {
- throw new IllegalArgumentException("className must be specified");
- }
- if (type == null)
- {
- throw new IllegalArgumentException("type must be specified");
- }
-
- return AccessController.doPrivileged(new PrivilegedAction<T>()
- {
- public T run()
- {
- try
- {
- final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- final Class<?> clazz = Class.forName(className, false, classLoader);
- final Object obj = clazz.newInstance();
- try
- {
- return type.cast(obj);
- }
- catch (final ClassCastException cee)
- {
- throw new IllegalArgumentException("Specified type " + type.getName() + " is not assignable to "
- + obj);
- }
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Unable to create implemenation: " + className, e);
- }
- }
- });
- }
-
-}
Deleted: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/JavaArchiveFactory.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/JavaArchiveFactory.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/JavaArchiveFactory.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.api.spec;
-
-
-/**
- * JavaArchiveFactory
- *
- * Factory used to create {@link JavaArchive} instances.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public abstract class JavaArchiveFactory extends ArchiveFactory<JavaArchive>
-{
-
- //-------------------------------------------------------------------------------------||
- // Class Members ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Implementation type as a FQN to avoid direct compile-time dependency
- */
- private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.spec.JavaArchiveFactoryImpl";
-
- /**
- * Instance of JavaArchiveFactory implementation
- */
- private static JavaArchiveFactory instance;
-
- //-------------------------------------------------------------------------------------||
- // Class Methods ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Creates a {@link JavaArchive} instance with the provided name.
- *
- * @param archiveName
- * @return JavaArchive
- * @throws IllegalArgumentException if the archiveName is not present
- */
- public static JavaArchive create(String archiveName)
- {
- return getInstance().doCreate(archiveName);
- }
-
- /**
- * Return instance of the JavaArchiveFactory
- *
- * @return
- */
- private synchronized static JavaArchiveFactory getInstance()
- {
- if (instance == null)
- {
- instance = createInstance(JavaArchiveFactory.class, IMPL_TYPE);
- }
- return instance;
- }
-}
Deleted: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ResourceAdapterArchiveFactory.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ResourceAdapterArchiveFactory.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/ResourceAdapterArchiveFactory.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.api.spec;
-
-
-/**
- * ResourceAdapterArchiveFactory
- *
- * Factory used to create {@link ResourceAdapterArchive} instances.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public abstract class ResourceAdapterArchiveFactory extends ArchiveFactory<ResourceAdapterArchive>
-{
-
- //-------------------------------------------------------------------------------------||
- // Class Members ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Implementation type as a FQN to avoid direct compile-time dependency
- */
- private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.spec.ResourceAdapterArchiveFactoryImpl";
-
- /**
- * Instance of ResourceAdapterArchiveFactory implementation
- */
- private static ResourceAdapterArchiveFactory instance;
-
- //-------------------------------------------------------------------------------------||
- // Class Methods ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Creates a {@link ResourceAdapterArchive} instance with the provided name.
- *
- * @param archiveName
- * @return ResourceAdapterArchive
- * @throws IllegalArgumentException if the archiveName is not present
- */
- public static ResourceAdapterArchive create(String archiveName)
- {
- return getInstance().doCreate(archiveName);
- }
-
- /**
- * Return instance of the ResourceAdapterArchive
- *
- * @return
- */
- private synchronized static ResourceAdapterArchiveFactory getInstance()
- {
- if (instance == null)
- {
- instance = createInstance(ResourceAdapterArchiveFactory.class, IMPL_TYPE);
- }
- return instance;
- }
-}
Deleted: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/WebArchiveFactory.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/WebArchiveFactory.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/WebArchiveFactory.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.api.spec;
-
-
-/**
- * WebArchiveFactory
- *
- * Factory used to create {@link WebArchive} instances.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public abstract class WebArchiveFactory extends ArchiveFactory<WebArchive>
-{
-
- //-------------------------------------------------------------------------------------||
- // Class Members ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Implementation type as a FQN to avoid direct compile-time dependency
- */
- private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.spec.WebArchiveFactoryImpl";
-
- /**
- * Instance of WebArchiveFactory implementation
- */
- private static WebArchiveFactory instance;
-
- //-------------------------------------------------------------------------------------||
- // Class Methods ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * Creates a {@link WebArchive} instance with the provided name.
- *
- * @param archiveName
- * @return WebArchive instance
- * @throws IllegalArgumentException if the archiveName is not present
- */
- public static WebArchive create(String archiveName)
- {
- return getInstance().doCreate(archiveName);
- }
-
- /**
- * Return instance of the WebArchiveFactory
- *
- * @return
- */
- private synchronized static WebArchiveFactory getInstance()
- {
- if (instance == null)
- {
- instance = createInstance(WebArchiveFactory.class, IMPL_TYPE);
- }
- return instance;
- }
-}
Deleted: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveFactoryImpl.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveFactoryImpl.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveFactoryImpl.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.spec;
-
-import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
-import org.jboss.shrinkwrap.api.spec.EnterpriseArchiveFactory;
-import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
-import org.jboss.shrinkwrap.spi.MemoryMapArchive;
-
-/**
- * EnterpriseArchiveFactoryImpl
- *
- * EnterpriseArchiveFactory implementation used to create {@link EnterpriseArchive} instances. Thread-safe.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class EnterpriseArchiveFactoryImpl extends EnterpriseArchiveFactory
-{
-
- /*
- * {@inheritDoc}
- * @see org.jboss.declarchive.api.EnterpriseArchiveFactory#doCreate(java.lang.String)
- */
- @Override
- protected EnterpriseArchive doCreate(String archiveName)
- {
- // Create storage delegate
- MemoryMapArchive memoryMapArchive = new MemoryMapArchiveImpl(archiveName);
-
- // Create enterprise archive
- EnterpriseArchive enterpriseArchive = new EnterpriseArchiveImpl(memoryMapArchive);
-
- // Return archive
- return enterpriseArchive;
- }
-
-}
Deleted: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveFactoryImpl.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveFactoryImpl.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveFactoryImpl.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.spec;
-
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.api.spec.JavaArchiveFactory;
-import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
-import org.jboss.shrinkwrap.spi.MemoryMapArchive;
-
-/**
- * JavaArchiveFactoryImpl
- *
- * JavaArchiveFactory implementation used to create {@link JavaArchive} instances. Thread-safe.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class JavaArchiveFactoryImpl extends JavaArchiveFactory
-{
-
- /*
- * {@inheritDoc}
- * @see org.jboss.declarchive.api.JavaArchiveFactory#doCreate(java.lang.String)
- */
- @Override
- protected JavaArchive doCreate(String archiveName)
- {
- // Create storage delegate
- MemoryMapArchive memoryMapArchive = new MemoryMapArchiveImpl(archiveName);
-
- // Create Java Archive
- JavaArchive javaArchive = new JavaArchiveImpl(memoryMapArchive);
-
- // Return archive
- return javaArchive;
- }
-
-}
Deleted: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/ResourceAdapterArchiveFactoryImpl.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/ResourceAdapterArchiveFactoryImpl.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/ResourceAdapterArchiveFactoryImpl.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.spec;
-
-import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
-import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchiveFactory;
-import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
-import org.jboss.shrinkwrap.spi.MemoryMapArchive;
-
-/**
- * ResourceAdapterArchiveFactoryImpl
- *
- * ResourceAdapterArchiveFactory implementation used to create {@link ResourceAdapterArchive} instances. Thread-safe.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class ResourceAdapterArchiveFactoryImpl extends ResourceAdapterArchiveFactory
-{
-
- /*
- * {@inheritDoc}
- * @see org.jboss.declarchive.api.ResourceAdapterArchiveFactory#doCreate(java.lang.String)
- */
- @Override
- protected ResourceAdapterArchive doCreate(String archiveName)
- {
- // Create storage delegate
- MemoryMapArchive memoryMapArchive = new MemoryMapArchiveImpl(archiveName);
-
- // Create Resource Adapter Archive
- ResourceAdapterArchive resourceAdapterArchive = new ResourceAdapterArchiveImpl(memoryMapArchive);
-
- // Return archive
- return resourceAdapterArchive;
- }
-
-}
Deleted: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveFactoryImpl.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveFactoryImpl.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveFactoryImpl.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.spec;
-
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.shrinkwrap.api.spec.WebArchiveFactory;
-import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
-import org.jboss.shrinkwrap.spi.MemoryMapArchive;
-
-/**
- * WebArchiveFactoryImpl
- *
- * WebArchiveFactory implementation used to create {@link WebArchive} instances. Thread-safe.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class WebArchiveFactoryImpl extends WebArchiveFactory
-{
-
- /*
- * {@inheritDoc}
- * @see org.jboss.declarchive.api.WebArchiveFactory#doCreate(java.lang.String)
- */
- @Override
- protected WebArchive doCreate(String archiveName)
- {
- // Create storage delegate
- MemoryMapArchive memoryMapArchive = new MemoryMapArchiveImpl(archiveName);
-
- // Create web archive
- WebArchive webArchive = new WebArchiveImpl(memoryMapArchive);
-
- // Return archive
- return webArchive;
- }
-
-}
Deleted: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/EnterpriseArchiveFactoryTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/EnterpriseArchiveFactoryTestCase.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/EnterpriseArchiveFactoryTestCase.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.unit;
-
-import junit.framework.Assert;
-
-import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
-import org.jboss.shrinkwrap.api.spec.EnterpriseArchiveFactory;
-import org.junit.Test;
-
-/**
- * EnterpriseArchiveFactoryTestCase
- *
- * TestCase to ensure the EnterpriseArchiveFactory functions correctly.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class EnterpriseArchiveFactoryTestCase
-{
-
- /**
- * Test to ensure EnterpriseArchiveFactory returns a valid archive
- * @throws Exception
- */
- @Test
- public void testCreateArchive() throws Exception
- {
- String name = "test.ear";
- EnterpriseArchive enterpriseArchive = EnterpriseArchiveFactory.create(name);
- Assert.assertNotNull("Should return a valid enterprise archive", enterpriseArchive);
- Assert.assertEquals("Should return the same name as factory arg", name, enterpriseArchive.getName());
- }
-
- /**
- * Test to ensure EnterpriseArchiveFactory.create requires an archive name
- * @throws Exception
- */
- @Test
- public void testCreateArchiveRequiresName() throws Exception
- {
- try
- {
- EnterpriseArchiveFactory.create(null);
- Assert.fail("Should have thrown IllegalArgumentException");
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- }
-
-}
Deleted: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/JavaArchiveFactoryTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/JavaArchiveFactoryTestCase.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/JavaArchiveFactoryTestCase.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.unit;
-
-import junit.framework.Assert;
-
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.api.spec.JavaArchiveFactory;
-import org.junit.Test;
-
-/**
- * JavaArchiveFactoryTestCase
- *
- * TestCase to ensure the JavaArchiveFactory functions correctly.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class JavaArchiveFactoryTestCase
-{
-
- /**
- * Test to ensure JavaArchiveFactory returns a valid archive
- * @throws Exception
- */
- @Test
- public void testCreateArchive() throws Exception
- {
- String name = "test.jar";
- JavaArchive javaArchive = JavaArchiveFactory.create(name);
- Assert.assertNotNull("Should return a valid java archive", javaArchive);
- Assert.assertEquals("Should return the same name as factory arg", name, javaArchive.getName());
- }
-
- /**
- * Test to ensure JavaArchiveFactory.create requires an archive name
- * @throws Exception
- */
- @Test
- public void testCreateArchiveRequiresName() throws Exception
- {
- try
- {
- JavaArchiveFactory.create(null);
- Assert.fail("Should have thrown IllegalArgumentException");
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- }
-
-}
Deleted: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/ResourceAdapterArchiveFactoryTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/ResourceAdapterArchiveFactoryTestCase.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/ResourceAdapterArchiveFactoryTestCase.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.unit;
-
-import junit.framework.Assert;
-
-import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
-import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchiveFactory;
-import org.junit.Test;
-
-/**
- * ResourceAdapterArchiveFactoryTestCase
- *
- * TestCase to ensure the ResourceAdapterArchiveFactory functions correctly.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class ResourceAdapterArchiveFactoryTestCase
-{
-
- /**
- * Test to ensure ResourceAdapterArchiveFactory returns a valid archive
- * @throws Exception
- */
- @Test
- public void testCreateArchive() throws Exception
- {
- String name = "test.rar";
- ResourceAdapterArchive resourceAdapterArchive = ResourceAdapterArchiveFactory.create(name);
- Assert.assertNotNull("Should return a valid resource adapter archive", resourceAdapterArchive);
- Assert.assertEquals("Should return the same name as factory arg", name, resourceAdapterArchive.getName());
- }
-
- /**
- * Test to ensure ResourceAdapterArchiveFactory.create requires an archive name
- * @throws Exception
- */
- @Test
- public void testCreateArchiveRequiresName() throws Exception
- {
- try
- {
- ResourceAdapterArchiveFactory.create(null);
- Assert.fail("Should have thrown IllegalArgumentException");
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- }
-
-}
Deleted: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/WebArchiveFactoryTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/WebArchiveFactoryTestCase.java 2009-11-11 09:49:05 UTC (rev 3659)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/WebArchiveFactoryTestCase.java 2009-11-11 10:01:28 UTC (rev 3660)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, 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.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.unit;
-
-import junit.framework.Assert;
-
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.shrinkwrap.api.spec.WebArchiveFactory;
-import org.junit.Test;
-
-/**
- * WebArchiveFactoryTestCase
- *
- * TestCase to ensure the WebArchiveFactory functions correctly.
- *
- * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
- * @version $Revision: $
- */
-public class WebArchiveFactoryTestCase
-{
-
- /**
- * Test to ensure WebArchiveFactory returns a valid archive
- * @throws Exception
- */
- @Test
- public void testCreateArchive() throws Exception
- {
- String name = "test.war";
- WebArchive webArchive = WebArchiveFactory.create(name);
- Assert.assertNotNull("Should return a valid web archive", webArchive);
- Assert.assertEquals("Should return the same name as factory arg", name, webArchive.getName());
- }
-
- /**
- * Test to ensure WebArchiveFactory.create requires an archive name
- * @throws Exception
- */
- @Test
- public void testCreateArchiveRequiresName() throws Exception
- {
- try
- {
- WebArchiveFactory.create(null);
- Assert.fail("Should have thrown IllegalArgumentException");
- }
- catch (IllegalArgumentException expected)
- {
- }
-
- }
-
-}
More information about the jboss-svn-commits
mailing list