Author: richard.opalka(a)jboss.com
Date: 2009-07-23 08:49:24 -0400 (Thu, 23 Jul 2009)
New Revision: 10373
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
Log:
[JBWS-2332] refactoring + fixing javadocs
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -122,5 +122,18 @@
this.aspect.stop( dep );
}
}
+
+ /**
+ * Displays also WS deployment aspect being used.
+ *
+ * @return deployer instance id including wrapped deployment aspect id.
+ */
+ @Override
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder();
+ sb.append( super.toString() ).append( '(' ).append( this.aspect ).append(
')' );
+ return sb.toString();
+ }
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -92,6 +92,7 @@
* Creates new Web Service deployment and registers it with deployment unit.
*
* @param unit deployment unit
+ * @throws DeploymentException if error occurs
*/
@Override
protected void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -44,6 +44,9 @@
/**
* Model factory generator.
+ *
+ * @param root object tree root
+ * @return object model factory
*/
@Override
protected ObjectModelFactory getObjectModelFactory( final WebservicesMetaData root )
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -70,26 +70,29 @@
/**
* Deploys WebServiceDeployment meta data.
+ *
+ * @param unit deployment unit
+ * @throws DeploymentException exception
*/
@Override
protected void internalDeploy( final DeploymentUnit unit ) throws DeploymentException
{
- final JBossMetaData mergedMD = ( JBossMetaData )unit.getAttachment(
+ final JBossMetaData mergedMD = ( JBossMetaData ) unit.getAttachment(
MergedJBossMetaDataDeployer.EJB_MERGED_ATTACHMENT_NAME
);
final Ejb3Deployment ejb3Deployment = unit.getAttachment( Ejb3Deployment.class );
- if( mergedMD != null )
+ if ( mergedMD != null )
{
final WebServiceDeploymentAdapter wsDeploymentAdapter = new
WebServiceDeploymentAdapter();
final Iterator< JBossEnterpriseBeanMetaData > ejbIterator =
mergedMD.getEnterpriseBeans().iterator();
- while( ejbIterator.hasNext() )
+ while ( ejbIterator.hasNext() )
{
final JBossEnterpriseBeanMetaData ejbMD = ejbIterator.next();
final EJBContainer ejbContainer = this.getContainer( ejb3Deployment, ejbMD
);
- if( ejbMD.getEjbClass() != null )
+ if ( ejbMD.getEjbClass() != null )
{
wsDeploymentAdapter.getServiceEndpoints().add(
new WebServiceDeclarationAdapter( ejbMD, ejbContainer,
unit.getClassLoader() )
@@ -114,9 +117,9 @@
* @throws DeploymentException if some error occurs
*/
private EJBContainer getContainer( final Ejb3Deployment ejb3Deployment, final
JBossEnterpriseBeanMetaData ejbMD )
- throws DeploymentException
+ throws DeploymentException
{
- if ( ( ejb3Deployment != null ) && ( ejbMD.isEntity() == false ) )
+ if ( ( ejb3Deployment != null ) && ( !ejbMD.isEntity() ) )
{
try
{
@@ -136,11 +139,14 @@
* Adopts EJB3 bean meta data to a
* {@link org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration}.
*/
- private static class WebServiceDeclarationAdapter implements WebServiceDeclaration
+ private static final class WebServiceDeclarationAdapter implements
WebServiceDeclaration
{
+ /** EJB meta data. */
private final JBossEnterpriseBeanMetaData ejbMetaData;
+ /** EJB container. */
private final EJBContainer ejbContainer;
+ /** Class loader. */
private final ClassLoader loader;
/**
@@ -187,7 +193,7 @@
/**
* Returns EJB name.
*
- * @returns name
+ * @return name
*/
public String getComponentName()
{
@@ -207,6 +213,8 @@
/**
* Returns requested annotation associated with EJB container or EJB bean.
*
+ * @param annotationType annotation type
+ * @param <T> annotation class type
* @return requested annotation or null if not found
*/
public < T extends Annotation > T getAnnotation( final Class<T>
annotationType )
@@ -246,22 +254,30 @@
/**
* Adopts an EJB deployment to a
- * {@link org.jboss.wsf.spi.deployment.integration.WebServiceDeployment}
+ * {@link org.jboss.wsf.spi.deployment.integration.WebServiceDeployment}.
*/
- private static class WebServiceDeploymentAdapter implements WebServiceDeployment
+ private static final class WebServiceDeploymentAdapter implements
WebServiceDeployment
{
/** List of endpoints. */
private final List< WebServiceDeclaration > endpoints = new ArrayList<
WebServiceDeclaration >();
/**
+ * Constructor.
+ */
+ private WebServiceDeploymentAdapter()
+ {
+ super();
+ }
+
+ /**
* Returns endpoints list.
*
* @return endpoints list
*/
public List< WebServiceDeclaration > getServiceEndpoints()
{
- return endpoints;
+ return this.endpoints;
}
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSVirtualFileFilter.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -25,57 +25,64 @@
import org.jboss.virtual.VisitorAttributes;
/**
- * VirtualFileFilter that can be used to search/filter files with the
- * suffix ".wsdl" and ".xsd".
- * <p/>
+ * WS file filter for files with the '.wsdl', or '.xsd' or '.xml'
suffix.
*
* @author <a href="mailto:dbevenius@jboss.com">Daniel
Bevenius</a>
- *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
-public class WSVirtualFileFilter implements VirtualFileFilterWithAttributes
+public final class WSVirtualFileFilter implements VirtualFileFilterWithAttributes
{
- /** The attributes */
+
+ /** The tree walking attributes. */
private VisitorAttributes attributes;
/**
- * No-args constructor.
- *
- * Will create a recursive filter by setting {@link
VisitorAttributes#RECURSE_LEAVES_ONLY}.
+ * Constructor.
*/
public WSVirtualFileFilter()
{
- this(VisitorAttributes.RECURSE_LEAVES_ONLY);
+ this( VisitorAttributes.RECURSE_LEAVES_ONLY );
}
/**
+ * Constructor.
*
- * @param attributes The {@link VisitorAttributes} value which determines the
recursive behaviour of this filter.
+ * @param attributes visit attributes
*/
- public WSVirtualFileFilter(final VisitorAttributes attributes)
+ public WSVirtualFileFilter( final VisitorAttributes attributes )
{
this.attributes = attributes;
}
/**
- * Retrieves the VisitorAttribute for this instance.
+ * Gets VisitorAttributes for this instance.
+ *
+ * @return visitor attributes
*/
public VisitorAttributes getAttributes()
{
- return attributes;
+ return this.attributes;
}
/**
- * Accepts files that end with .wsdl and .xsd.
- *
- * @return {@code true} If the file name ends with either .wsdl or .xsd. Otherwise
returns false.
+ * Accepts files that end with '.wsdl' or '.xsd' or '.xml'.
+ *
+ * @param file to analyze
+ * @return true if expected file extension, false otherwise
*/
- public boolean accepts(final VirtualFile file)
+ public boolean accepts( final VirtualFile file )
{
- if (file == null)
+ if ( file == null )
+ {
return false;
+ }
- final String fileName = file.getName();
- return fileName.endsWith(".wsdl") || fileName.endsWith(".xsd")
|| fileName.endsWith(".xml");
+ final String fileName = file.getName().toLowerCase();
+ final boolean hasWsdlSuffix = fileName.endsWith( ".wsdl" );
+ final boolean hasXsdSuffix = fileName.endsWith( ".xsd" );
+ final boolean hasXmlSuffix = fileName.endsWith( ".xml" );
+
+ return hasWsdlSuffix || hasXsdSuffix || hasXmlSuffix;
}
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -35,26 +35,43 @@
*/
public final class ContainerMetaDataBuilder
{
-
+
+ /** JSE meta data builder. */
private JSEMetaDataBuilder jseMetaDataBuilder = new JSEMetaDataBuilder();
+ /** EJB3 meta data builder. */
private EJB3MetaDataBuilder ejb3MetaDataBuilder = new EJB3MetaDataBuilder();
+ /** EJB21 meta data builder. */
private EJB21MetaDataBuilder ejb21MetaDataBuilder = new EJB21MetaDataBuilder();
+ /**
+ * Constructor.
+ */
+ public ContainerMetaDataBuilder()
+ {
+ super();
+ }
+
+ /**
+ * Creates container independent meta data and deploys it to <b>dep</b>.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
public void create( final Deployment dep, final DeploymentUnit unit )
{
if ( Helper.isJseDeployment( unit ) )
{
- final JSEArchiveMetaData jseMetaData = jseMetaDataBuilder.create( dep, unit );
+ final JSEArchiveMetaData jseMetaData = this.jseMetaDataBuilder.create( dep, unit
);
dep.addAttachment( JSEArchiveMetaData.class, jseMetaData );
}
else if ( Helper.isJaxwsEjbDeployment( unit ) )
{
- final EJBArchiveMetaData ejbMetaData = ejb3MetaDataBuilder.create( dep, unit );
+ final EJBArchiveMetaData ejbMetaData = this.ejb3MetaDataBuilder.create( dep,
unit );
dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
}
else if ( Helper.isJaxrpcEjbDeployment( unit ) )
{
- final EJBArchiveMetaData ejbMetaData = ejb21MetaDataBuilder.create( dep, unit
);
+ final EJBArchiveMetaData ejbMetaData = this.ejb21MetaDataBuilder.create( dep,
unit );
dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
}
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -34,13 +34,32 @@
public final class ContainerMetaDataDeploymentAspect extends DeploymentAspect
{
+ /** Container independent meta data builder. */
private ContainerMetaDataBuilder metaDataBuilder;
+ /**
+ * Constructor.
+ */
+ public ContainerMetaDataDeploymentAspect()
+ {
+ super();
+ }
+
+ /**
+ * Sets container independent meta data builder via MC injection.
+ *
+ * @param builder meta data builder
+ */
public void setMetaDataBuilder( final ContainerMetaDataBuilder builder )
{
this.metaDataBuilder = builder;
}
+ /**
+ * Build container independent meta data.
+ *
+ * @param dep webservice deployment
+ */
@Override
public void start( final Deployment dep )
{
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB21MetaDataBuilder.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -48,7 +48,6 @@
* Builds container independent meta data from EJB21 container meta data.
*
* @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
final class EJB21MetaDataBuilder
{
@@ -160,8 +159,6 @@
targetBean.setEjbName(jbossMessageBean.getEjbName());
targetBean.setEjbClass(jbossMessageBean.getEjbClass());
- //targetBean.setServiceEndpointInterface(???);
- //targetBean.setJndiName(???);
targetBean.setLocalJndiName(jbossBeansMetaData.getLocalJndiName());
((MDBMetaData)targetBean).setDestinationJndiName(jbossMessageBean.getDestinationJndiName());
}
@@ -171,4 +168,5 @@
return targetBean;
}
+
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/EJB3MetaDataBuilder.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -43,7 +43,6 @@
* Builds container independent meta data from EJB3 container meta data.
*
* @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
final class EJB3MetaDataBuilder
{
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java 2009-07-23
10:25:07 UTC (rev 10372)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/JSEMetaDataBuilder.java 2009-07-23
12:49:24 UTC (rev 10373)
@@ -51,7 +51,6 @@
* Builds container independent meta data from WEB container meta data.
*
* @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
*/
final class JSEMetaDataBuilder
{