Author: alessio.soldano(a)jboss.com
Date: 2010-01-25 05:09:25 -0500 (Mon, 25 Jan 2010)
New Revision: 11476
Added:
common/branches/jaxrpc-cxf/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
Log:
Providing AbstractDeploymentAspect
Added:
common/branches/jaxrpc-cxf/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
===================================================================
---
common/branches/jaxrpc-cxf/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
(rev 0)
+++
common/branches/jaxrpc-cxf/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java 2010-01-25
10:09:25 UTC (rev 11476)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.common.integration;
+
+import java.lang.ref.WeakReference;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+
+/**
+ * Abstract deployment aspect every other one extends
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 21-Jan-2010
+ *
+ */
+public class AbstractDeploymentAspect implements DeploymentAspect
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(getClass());
+
+ private String provides;
+ private String requires;
+ private int relativeOrder;
+ private boolean isLast;
+ private boolean isForJaxWs = true;
+ private boolean isForJaxRpc = true;
+ private WeakReference<ClassLoader> loader;
+
+ public AbstractDeploymentAspect()
+ {
+ //TODO!!! Use security action
+ this.loader = new
WeakReference<ClassLoader>(Thread.currentThread().getContextClassLoader());
+ }
+
+ public ClassLoader getLoader()
+ {
+ return loader != null ? loader.get() : null;
+ }
+
+ public void setLast(boolean isLast)
+ {
+ this.isLast = isLast;
+ }
+
+ public boolean isLast()
+ {
+ return this.isLast;
+ }
+
+ public String getProvides()
+ {
+ return provides;
+ }
+
+ public void setProvides(String provides)
+ {
+ this.provides = provides;
+ }
+
+ public String getRequires()
+ {
+ return requires;
+ }
+
+ public void setRequires(String requires)
+ {
+ this.requires = requires;
+ }
+
+ public void setRelativeOrder(int relativeOrder)
+ {
+ this.relativeOrder = relativeOrder;
+ }
+
+ public int getRelativeOrder()
+ {
+ return this.relativeOrder;
+ }
+
+ public void start(Deployment dep)
+ {
+ }
+
+ public void stop(Deployment dep)
+ {
+ }
+
+ public Set<String> getProvidesAsSet()
+ {
+ Set<String> condset = new HashSet<String>();
+ if (provides != null)
+ {
+ StringTokenizer st = new StringTokenizer(provides, ", \r\n\t");
+ while (st.hasMoreTokens())
+ condset.add(st.nextToken());
+ }
+ return condset;
+ }
+
+ public Set<String> getRequiresAsSet()
+ {
+ Set<String> condset = new HashSet<String>();
+ if (requires != null)
+ {
+ StringTokenizer st = new StringTokenizer(requires, ", \r\n\t");
+ while (st.hasMoreTokens())
+ condset.add(st.nextToken());
+ }
+ return condset;
+ }
+
+ public boolean canHandle(Deployment dep)
+ {
+ return (this.isForJaxWs && WSHelper.isJaxwsDeployment(dep) ||
+ this.isForJaxRpc && WSHelper.isJaxrpcDeployment(dep));
+ }
+
+ public boolean isForJaxWs()
+ {
+ return isForJaxWs;
+ }
+
+ public void setForJaxWs(boolean isForJaxWs)
+ {
+ this.isForJaxWs = isForJaxWs;
+ }
+
+ public boolean isForJaxRpc()
+ {
+ return isForJaxRpc;
+ }
+
+ public void setForJaxRpc(boolean isForJaxRpc)
+ {
+ this.isForJaxRpc = isForJaxRpc;
+ }
+}
Property changes on:
common/branches/jaxrpc-cxf/src/main/java/org/jboss/wsf/common/integration/AbstractDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF