You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by sc...@apache.org on 2006/06/02 19:33:13 UTC
svn commit: r411218 [10/34] - in /webservices/muse: branches/1.0/
branches/1.0/src/examples/broker/ branches/1.0/src/examples/broker/WEB-INF/
branches/1.0/src/examples/consumer/ branches/1.0/src/examples/consumer/epr/
branches/1.0/src/examples/consumer...
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidResourceKeyException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidResourceKeyException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidResourceKeyException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidResourceKeyException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,64 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * LOG-DONE
+ * This exception is raised if the {@link ResourceKey ResourceKey} is in any way invalid.
+ */
+public class InvalidResourceKeyException
+ extends ResourceException
+{
+ /**
+ * Creates a new {@link InvalidResourceKeyException} object.
+ */
+ public InvalidResourceKeyException( )
+ {
+ }
+
+ /**
+ * Creates a new {@link InvalidResourceKeyException} object.
+ *
+ * @param message DOCUMENT_ME
+ */
+ public InvalidResourceKeyException( String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Creates a new {@link InvalidResourceKeyException} object.
+ *
+ * @param message DOCUMENT_ME
+ * @param ex DOCUMENT_ME
+ */
+ public InvalidResourceKeyException( String message,
+ Throwable ex )
+ {
+ super( message, ex );
+ }
+
+ /**
+ * Creates a new {@link InvalidResourceKeyException} object.
+ *
+ * @param ex DOCUMENT_ME
+ */
+ public InvalidResourceKeyException( Throwable ex )
+ {
+ super( ex );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidWsrfWsdlException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidWsrfWsdlException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidWsrfWsdlException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/InvalidWsrfWsdlException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,36 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * Indicates a semantic error was found while validating a WSRF WSDL.
+ *
+ * @author Ian P. Springer (Hewlett-Packard Company)
+ */
+public class InvalidWsrfWsdlException
+ extends Exception
+{
+ /**
+ * Creates a new {@link InvalidWsrfWsdlException} object.
+ *
+ * @param s DOCUMENT_ME
+ */
+ public InvalidWsrfWsdlException( String s )
+ {
+ super( s );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/JndiConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/JndiConstants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/JndiConstants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/JndiConstants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,85 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * JNDI-related constants.
+ *
+ * @author Ian P. Springer (Hewlett-Packard Company)
+ */
+public interface JndiConstants
+{
+ /**
+ * JNDI base path
+ */
+ String CONTEXT_NAME_BASE = "wsrf";
+
+ /**
+ * JNDI base path
+ */
+ String CONTEXT_SERVICES_BASE = "services";
+
+ /**
+ * JNDI base path
+ */
+ String CONTEXT_GLOBAL_BASE = "global";
+
+ /**
+ * JNDI services base path
+ */
+ String CONTEXT_NAME_SERVICES = CONTEXT_NAME_BASE + "/" + CONTEXT_SERVICES_BASE;
+
+ /**
+ * JNDI global base path
+ */
+ String CONTEXT_NAME_GLOBAL = CONTEXT_NAME_BASE + "/" + CONTEXT_GLOBAL_BASE;
+
+ /**
+ * JNDI path to the default work manager
+ */
+ String KEY_NAME_DEFAULT_WORK_MANAGER = CONTEXT_NAME_GLOBAL + "/wm/ContainerWorkManager";
+
+ /**
+ * JNDI path to the default timer manager
+ */
+ String KEY_NAME_DEFAULT_TIMER = CONTEXT_NAME_GLOBAL + "/timer/ContainerTimer";
+
+ /**
+ * JNDI path to the default query engine
+ */
+ String KEY_NAME_DEFAULT_QUERY_ENGINE = CONTEXT_NAME_GLOBAL + "/query/ContainerQueryEngine";
+
+ /**
+ * JNDI path to the default topic expression engine
+ */
+ String KEY_NAME_DEFAULT_TOPIC_EXPRESSION_ENGINE = CONTEXT_NAME_GLOBAL + "/topic/ContainerTopicExpressionEngine";
+
+ /**
+ * JNDI path to the default topic expression evaluator
+ */
+ String TOPIC_EXPRESSION_EVALUATOR_CONTEXT = CONTEXT_NAME_GLOBAL + "/topic/eval";
+
+ /**
+ * JNDI path appended to JNDI service path when looking up the service's resource home
+ */
+ String ATOMIC_NAME_HOME = "home";
+
+ /**
+ * JNDI path appended to JNDI service path when looking up the service's resource metadata
+ */
+ String ATOMIC_METADATA_CONTEXT = "metadata";
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NamespaceConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NamespaceConstants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NamespaceConstants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NamespaceConstants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,39 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * Implementation specific constants. The NS constants point to the currently supported
+ * namespace versions.
+ */
+public interface NamespaceConstants
+{
+ /**
+ *
+ */
+ String NSURI_APACHE_WS_RESOURCE = "http://ws.apache.org/namespaces/wsrf/";
+
+ /**
+ * DOCUMENT_ME
+ */
+ String NSPREFIX_APACHE_WS_RESOURCE = "asf-wsrf";
+
+ /**
+ * DOCUMENT_ME
+ */
+ String NSURI_GLOBUS_CORE = "http://www.globus.org/namespaces/2004/06/core";
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NoResourceHomeException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NoResourceHomeException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NoResourceHomeException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/NoResourceHomeException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,65 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * LOG-DONE
+ * This is a basic exception raised by {@link ResourceContext ResourceContext} operations in cases where a ResourceHome
+ * is not configured for a given service.
+ */
+public class NoResourceHomeException
+ extends ResourceContextException
+{
+ /**
+ * Creates a NoResourceHomeException without error message.
+ */
+ public NoResourceHomeException( )
+ {
+ }
+
+ /**
+ * Creates a NoResourceHomeException with a given error message.
+ *
+ * @param message error message
+ */
+ public NoResourceHomeException( String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Creates a NoResourceHomeException with a given error message and nested exception.
+ *
+ * @param message error message
+ * @param exception nested exception/
+ */
+ public NoResourceHomeException( String message,
+ Throwable exception )
+ {
+ super( message, exception );
+ }
+
+ /**
+ * Creates a NoResourceHomeException from a nested exception.
+ *
+ * @param exception nested exception
+ */
+ public NoResourceHomeException( Throwable exception )
+ {
+ super( "", exception );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/OperationProviderRegistry.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/OperationProviderRegistry.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/OperationProviderRegistry.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/OperationProviderRegistry.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,42 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author Ian P. Springer
+ */
+public interface OperationProviderRegistry
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @param operationName DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ String getProviderClassName( QName operationName );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param operationName DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ String getProviderMethodName( QName operationName );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PersistentResource.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PersistentResource.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PersistentResource.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PersistentResource.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,42 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * An interface to be implemented by a resource which
+ * wants to be persisted.
+ *
+ * @author Sal Campana
+ */
+public interface PersistentResource
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws ResourceException DOCUMENT_ME
+ */
+ void load( )
+ throws ResourceException;
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws ResourceException DOCUMENT_ME
+ */
+ void store( )
+ throws ResourceException;
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PropertiesResource.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PropertiesResource.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PropertiesResource.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/PropertiesResource.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,39 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import org.apache.ws.resource.properties.ResourcePropertySet;
+
+/**
+ * A resource that has a properties document, as defined by WSRF-RP.
+ */
+public interface PropertiesResource
+ extends Resource
+{
+ /**
+ * Sets this resource's property set.
+ *
+ * @param propSet a resource property set
+ */
+ void setResourcePropertySet( ResourcePropertySet propSet );
+
+ /**
+ * Returns this resource's property set.
+ *
+ * @return this resource's property set
+ */
+ ResourcePropertySet getResourcePropertySet( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/Resource.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/Resource.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/Resource.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/Resource.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,75 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.resource.lifetime.ResourceTerminationListener;
+
+/**
+ * A marker interface for a resource. All resource objects must implement this interface.
+ */
+public interface Resource
+{
+ /**
+ * Sets the EndpointReference associated with this Resource.
+ *
+ * @param epr The EndpointReference for the Resource.
+ */
+ void setEndpointReference( EndpointReference epr );
+
+ /**
+ * Returns the EndpointReference associated with this Resource.
+ *
+ * @return The Resource's EndpointReference
+ */
+ EndpointReference getEndpointReference( );
+
+ /**
+ * @param id
+ *
+ * @throws IllegalArgumentException if the specified ID is not the of the correct type for this resource
+ * @throws IllegalStateException if this resource's ID has already been set
+ */
+ void setID( Object id );
+
+ /**
+ * Returns the unique id of the resource. In most cases, this value should match value returned by {@link
+ * ResourceKey#getValue}.
+ *
+ * @return the id of the resource.
+ */
+ Object getID( );
+
+ /**
+ * Adds a listener to be invoked when the resource has been terminated.
+ *
+ * @param listener
+ */
+ void addTerminationListener( ResourceTerminationListener listener );
+
+ /**
+ * Called by the resource home to indicate to a resource that the resource is
+ * being taken out of service.
+ */
+ void destroy( );
+
+ /**
+ * Called by the resource home to indicate to a resource that the resource is
+ * being placed into service. A resource can use this method to initialize
+ * its properties or any other state.
+ */
+ void init( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCapability.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCapability.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCapability.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCapability.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,110 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import javax.wsdl.Definition;
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+/**
+ * A WSRF resource capability (i.e. set of operations and properties).
+ *
+ * @author Ian Springer
+ */
+public interface ResourceCapability
+{
+ /**
+ * @return the names of all custom operations (i.e. operations that are not derived from a "base"
+ * ResourceDefinition)
+ */
+ String[] getCustomOperationNames( );
+
+ /**
+ * @return the names of all custom properties (i.e. proeprties that are not derived from a "base"
+ * ResourceDefinition)
+ */
+ QName[] getCustomPropertyNames( );
+
+ /**
+ * Returns the JWSDL {@link Definition} for this WS-Resource capability.
+ *
+ * @return
+ */
+ Definition getDefinition( );
+
+ /**
+ * @return a map of any other {@link ResourceCapability}s that this capability implements;
+ * the map's keys are the {@link QName}s of the capability portTypes, and the values
+ * are the ResourceCapabilitys.
+ */
+ Map getImplementedResourceCapabilities( );
+
+ /**
+ * Returns the location of the WS-RMD metadata definitions document, as specified by
+ * the wsrmd:MetadataDescriptorLocation attribute on the portType, or null if this
+ * resource does not define a metadata descriptor.
+ *
+ * @return
+ */
+ String getMetadataDescriptorLocation( );
+
+ /**
+ * Returns the name of the WS-RMD metadata descriptor, as specified by
+ * the wsrmd:MetadataDescriptor attribute on the portType, or null if this
+ * resource does not define a metadata descriptor.
+ *
+ * @return
+ */
+ QName getMetadataDescriptorName( );
+
+ /**
+ * Returns the JWSDL {@link PortType} corresponding to this WS-Resource capability.
+ *
+ * @return
+ */
+ PortType getPortType( );
+
+ /**
+ * Returns the name of the resource properties document element, as specified by
+ * the wsrf-rp:ResourceProperties attribute on the portType, or null if this
+ * resource does not define a properties document.
+ *
+ * @return
+ */
+ QName getPropertiesDocumentName( );
+
+ /**
+ * Returns a list of the QNames of the resource properties that are defined for the specified portType, or null if
+ * the portType does not have any associated resource properties.
+ *
+ * @return the QNames of the resource properties defined for the specified portType
+ */
+ QName[] getPropertyNames( );
+
+ /**
+ * @return true if this resource defines a resource properties document, or false if it does not
+ */
+ boolean hasProperties( );
+
+ /**
+ *
+ * @param capabilityName
+ *
+ * @return
+ */
+ boolean implementsResourceCapability( QName capabilityName );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContext.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContext.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContext.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContext.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,118 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import javax.xml.soap.SOAPMessage;
+import java.net.URI;
+import java.net.URL;
+import java.util.Iterator;
+
+/**
+ * Context information pertaining to a specific request being processed by the WSRF
+ * resource invocation framework. Provides methods for obtaining the {@link ResourceHome}
+ * and {@link Resource} objects associated with the request. Also provides access to
+ * some service related information such as the service endpoint URL.
+ */
+public interface ResourceContext
+{
+ /**
+ * @see SOAPMessageContext#getProperty(String)
+ */
+ public abstract Object getProperty( String name );
+
+ /**
+ * @see SOAPMessageContext#getPropertyNames()
+ */
+ public abstract Iterator getPropertyNames( );
+
+ /**
+ * Gets the base URL from which service URLs are based.
+ *
+ * @return The String representation of the base url
+ */
+ String getBaseURL( );
+
+ /**
+ * @see SOAPMessageContext#setProperty(String, Object)
+ */
+ void setProperty( String name,
+ Object value );
+
+ /**
+ * Returns the value of the request's wsa:Action header element.
+ *
+ * @return the value of the request's wsa:Action header element
+ */
+ String getRequestAction( );
+
+ /**
+ * Returns the resource instance that was targeted by the request associated
+ * with this context.
+ *
+ * @return the resource instance that was targeted by the request associated
+ * with this context
+ *
+ * @throws ResourceException upon failure to lookup a resource instance from the home
+ */
+ Resource getResource( )
+ throws ResourceException;
+
+ /**
+ * Gets <code>ResourceHome</code> associated with the service.
+ *
+ * @return <code>ResourceHome</code> associated with the service. Cannot be null.
+ */
+ ResourceHome getResourceHome( );
+
+ /**
+ * Sets the value that should be used for the response's wsa:Action header element.
+ *
+ * @param action the value that should be used for the response's wsa:Action header element;
+ * if null, a default value will be generated by the resource invocation framework
+ */
+ void setResponseAction( URI action );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ SOAPMessage getSOAPMessage( );
+
+ /**
+ * Gets name of the service.
+ *
+ * @return The name of the service.
+ */
+ String getServiceName( );
+
+ /**
+ * Gets the endpoint URL of the service.
+ *
+ * @return The endpoint URL of the service
+ */
+ URL getServiceURL( );
+
+ /**
+ * @see SOAPMessageContext#containsProperty(String)
+ */
+ boolean containsProperty( String name );
+
+ /**
+ * @see SOAPMessageContext#removeProperty(String)
+ */
+ void removeProperty( String name );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContextException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContextException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContextException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceContextException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,65 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import java.rmi.RemoteException;
+
+/**
+ * LOG-DONE
+ * This is a basic exception raised by {@link ResourceContext ResourceContext} operations.
+ */
+public class ResourceContextException
+ extends RemoteException
+{
+ /**
+ * Creates a ResourceContextException without error message.
+ */
+ public ResourceContextException( )
+ {
+ }
+
+ /**
+ * Creates a ResourceContextException with a given error message.
+ *
+ * @param message error message
+ */
+ public ResourceContextException( String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Creates a ResourceContextException with a given error message and nested exception.
+ *
+ * @param message error message
+ * @param exception nested exception/
+ */
+ public ResourceContextException( String message,
+ Throwable exception )
+ {
+ super( message, exception );
+ }
+
+ /**
+ * Creates a ResourceContextException from a nested exception.
+ *
+ * @param exception nested exception
+ */
+ public ResourceContextException( Throwable exception )
+ {
+ super( "", exception );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreation.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreation.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreation.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreation.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,40 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * An interface for exposing resource creation events.
+ *
+ * @author Sal Campana
+ */
+public interface ResourceCreation
+{
+ /**
+ * Adds a listener for ResourceCreationEvents
+ *
+ * @param listener
+ */
+ void addResourceCreationListener( ResourceCreationListener listener );
+
+ /**
+ * Removes a listener for ResourceCreationEvents
+ *
+ * @param listener
+ * @return true if the listener was removed, else false
+ */
+ boolean removeResourceCreationListener( ResourceCreationListener listener );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationEvent.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationEvent.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationEvent.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationEvent.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,49 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * A Resource Creation Event which contains the EndpointReference for
+ * the Resource which was created.
+ *
+ * @author Sal Campana
+ */
+public class ResourceCreationEvent
+ implements ResourceEvent
+{
+ private Resource m_resource;
+
+ /**
+ * Creates a new {@link ResourceCreationEvent} object.
+ *
+ * @param resource DOCUMENT_ME
+ */
+ public ResourceCreationEvent( Resource resource )
+ {
+ m_resource = resource;
+ }
+
+ /**
+ * Returns the Resource for which the event has occurred.
+ *
+ * @return EndpointReference
+ */
+ public Resource getResource( )
+ {
+ return m_resource;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationListener.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationListener.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationListener.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceCreationListener.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,34 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * This interface is provided for listeners to be able to be notified
+ * when a Resource is added to the ResourceHome. Addition to the home
+ * is viewed as the resource being created and accessible.
+ *
+ * @author Sal Campana
+ */
+public interface ResourceCreationListener
+{
+ /**
+ * Method to receive notifcations when resources are created (added to the home).
+ *
+ * @param rce
+ */
+ void creationOccurred( ResourceCreationEvent rce );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDefinition.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDefinition.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDefinition.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDefinition.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,48 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import javax.wsdl.Port;
+
+/**
+ * A WSRF resource definition.
+ *
+ * @author Ian Springer (ian DOT springer AT hp DOT com)
+ */
+public interface ResourceDefinition
+ extends ResourceCapability
+{
+ /**
+ * Returns the service endpoint URL for this resource definition.
+ *
+ * @return the service endpoint URL for this resource definition
+ */
+ String getEndpointURL( );
+
+ /**
+ * Returns the last portion of the service endpoint URL for this resource definition.
+ *
+ * @return the last portion of the service endpoint URL for this resource definition
+ */
+ String getName( );
+
+ /**
+ * Returns the JWSDL Service for this resource definition.
+ *
+ * @return the JWSDL Service for this resource definition
+ */
+ Port getPort( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestruction.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestruction.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestruction.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestruction.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,40 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * An interface for exposing resource destruction events.
+ *
+ * @author Sal Campana
+ */
+public interface ResourceDestruction
+{
+ /**
+ * Adds a listener for ResourceDestructionEvents
+ *
+ * @param listener
+ */
+ void addResourceDestructionListener( ResourceDestructionListener listener );
+
+ /**
+ * Removes a listener for ResourceDestructionEvents
+ *
+ * @param listener
+ * @return true if the listener was removed, else false
+ */
+ boolean removeResourceDestructionListener( ResourceDestructionListener listener );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionEvent.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionEvent.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionEvent.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionEvent.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,55 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import org.apache.ws.addressing.EndpointReference;
+
+/**
+ * A Resource Destruction Event which contains the EndpointReference for
+ * the Resource which was destroyed.
+ *
+ * @author Sal Campana
+ */
+public class ResourceDestructionEvent
+ implements ResourceEvent
+{
+ /** DOCUMENT_ME */
+ EndpointReference m_epr;
+
+ /** DOCUMENT_ME */
+ Object m_resourceId;
+ private Resource m_resource;
+
+ /**
+ * Creates a new {@link ResourceDestructionEvent} object.
+ *
+ * @param resource DOCUMENT_ME
+ */
+ public ResourceDestructionEvent( Resource resource )
+ {
+ m_resource = resource;
+ }
+
+ /**
+ * Returns the Resource of the resource the event is about.
+ *
+ * @return The resource.
+ */
+ public Resource getResource( )
+ {
+ return m_resource;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionListener.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionListener.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionListener.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceDestructionListener.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,34 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * This interface is provided for listeners to be able to be notified
+ * when a Resource is removed from the ResourceHome. Removal from the home
+ * is viewed as the resource being destroyed and unaccessible.
+ *
+ * @author Sal Campana
+ */
+public interface ResourceDestructionListener
+{
+ /**
+ * Method to receive notifcations when resources are deleted (removed from home).
+ *
+ * @param rde
+ */
+ void destructionOccurred( ResourceDestructionEvent rde );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceEvent.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceEvent.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceEvent.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceEvent.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,32 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * An interface defining a base event for resource destruction and creation.
+ *
+ * @author Sal Campana
+ */
+public interface ResourceEvent
+{
+ /**
+ * Returns the Resource for which the event has occurred.
+ *
+ * @return EndpointReference
+ */
+ Resource getResource( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,65 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import java.rmi.RemoteException;
+
+/**
+ * LOG-DONE
+ * This is a basic exception raised by resources or {@link ResourceHome ResourceHome} operations.
+ */
+public class ResourceException
+ extends RemoteException
+{
+ /**
+ * Creates a ResourceException without error message.
+ */
+ public ResourceException( )
+ {
+ }
+
+ /**
+ * Creates a ResourceException with a given error message.
+ *
+ * @param message error message
+ */
+ public ResourceException( String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Creates a ResourceException with a given error message and nested exception.
+ *
+ * @param message error message
+ * @param exception nested exception/
+ */
+ public ResourceException( String message,
+ Throwable exception )
+ {
+ super( message, exception );
+ }
+
+ /**
+ * Creates a ResourceException from a nested exception.
+ *
+ * @param exception nested exception
+ */
+ public ResourceException( Throwable exception )
+ {
+ super( "", exception );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceHome.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceHome.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceHome.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceHome.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,156 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+
+/**
+ * Defines a basic interface through which resources are discovered and removed. The purpose of
+ * <code>ResourceHome</code> is to interact with a collection of resources of the same type. Each resource type will
+ * have its own custom implementation the <code>ResourceHome</code> interface. The implementation is expected to provide
+ * custom methods for creating new resources and optionally methods that act on a set of resource objects.
+ */
+public interface ResourceHome
+ extends ResourceCreation,
+ ResourceDestruction
+{
+ /**
+ * Sets the classname of the Resource Impl.
+ *
+ * @param className The class name of the Resource Impl.
+ */
+ void setResourceClassName( String className );
+
+ /**
+ * Returns the Class of the Resource Impl.
+ *
+ * @return The Class of the Resource Impl
+ */
+ String getResourceClassName( );
+
+ /**
+ * Sets the name of the SOAP header element from which this home will extract
+ * a resource identifier. Set to null if this home manages a singleton resource.
+ *
+ * @param name resource identifier header element name, represented as
+ * a string as defined by {@link javax.xml.namespace.QName#toString()}
+ * (e.g. "{http://http://ws.apache.org/namespaces/wsrf/}ResourceIdentifier")
+ */
+ void setResourceIdentifierReferenceParameterName( String name );
+
+ /**
+ * Gets the name of the SOAP header element from which this home will extract
+ * a resource identifier.
+ *
+ * @return the resource identifier header element name, represented as
+ * a string in the format defined by
+ * {@link javax.xml.namespace.QName#toString()};
+ * or null if this home manages a singleton resource
+ */
+ String getResourceIdentifierReferenceParameterName( );
+
+ /**
+ * Sets the Service Impl's .Class
+ *
+ * @param className String representation of the class
+ */
+ void setServiceClassName( String className );
+
+ /**
+ * Returns the name of the Service class.
+ *
+ * @return the name of the Service class
+ */
+ String getServiceClassName( );
+
+ /**
+ * Sets the target namespace of the WSDL of this home's service.
+ *
+ * @param targetNamespace
+ */
+ void setWsdlTargetNamespace( String targetNamespace );
+
+ /**
+ * Returns the target namespace of the WSDL.
+ *
+ * @return The String of the targetnamespace
+ */
+ String getWsdlTargetNamespace( );
+
+ /**
+ * Adds the specified resource to this home if it is not already present
+ * (optional operation). More formally, adds the specified resource,
+ * <code>resource</code>, to this home if this home contains no resource
+ * <code>existing</code> such that
+ * <code>(resource.getID().equals(existing.getID())</code>.
+ * If this home already contains a resource with the same ID as the
+ * specified resource, the call leaves the home unchanged and returns
+ * <tt>false</tt>.
+ *
+ * This method will also check to see if the EndpointReference (EPR) has been set on
+ * the Resource. If the EPR is null, it will create one and set it on the Resource.
+ *
+ * @param resource the resource to be added; must not be null
+ *
+ * @throws UnsupportedOperationException if the <tt>add</tt> method is not
+ * supported by this home
+ * @throws IllegalResourceTypeException if the resource is not of the type
+ * supported by this home
+ */
+ boolean add( Resource resource )
+ throws IllegalResourceTypeException;
+
+ /**
+ * Extracts the resource identifier from the specified resource context -
+ * typically, this is done by deserializing a particular SOAP header
+ * element that contains the identifier.
+ *
+ * @param context a resource context
+ *
+ * @return the resource identifier
+ */
+ Object extractResourceIdentifier( ResourceContext context );
+
+ /**
+ * Retrieves a resource. <b>Note:</b> This function must not return null. It must
+ * either return the resource object or throw an exception if there is no resource
+ * with the specified identifier.
+ * </br>
+ * If a resource is found and its EndpointReference member variable is not set, the
+ * EndpointReference variable will get set on the resource with values obtained from
+ * the jndi-config configuration.
+ *
+ * @param resourceId a resource identifier
+ *
+ * @return non-null resource
+ *
+ * @throws ResourceUnknownException if no resource exists with the given key
+ * @throws ResourceException if any other error occurs.
+ */
+ Resource find( Object resourceId )
+ throws ResourceUnknownException,
+ ResourceException;
+
+ /**
+ * Removes a resource. Invokes the resource's {@link Resource#destroy()} method
+ * prior to removal.
+ *
+ * @throws ResourceUnknownException if no resource exists with the given key
+ * @throws ResourceException if any other error occurs
+ */
+ void remove( Object resourceId )
+ throws ResourceUnknownException,
+ ResourceException;
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceUnknownException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceUnknownException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceUnknownException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/ResourceUnknownException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,65 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource;
+
+import org.apache.ws.resource.i18n.Keys;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.util.i18n.Messages;
+
+/**
+ * Indicates that a {@link Resource} instance with the specified id
+ * was not found in the corresponding {@link ResourceHome}.
+ */
+public class ResourceUnknownException
+ extends ResourceException
+{
+ /** DOCUMENT_ME */
+ public static final Messages MSG = MessagesImpl.getInstance( );
+ private Object m_resourceId;
+ private String m_serviceName;
+
+ /**
+ * @param resourceId the resource id that was unknown
+ * @param serviceName the name of the service associated with the home where we tried to lookup the resource
+ */
+ public ResourceUnknownException( Object resourceId,
+ String serviceName )
+ {
+ super( MSG.getMessage( Keys.RESOURCE_NOT_FOUND, resourceId, serviceName ) );
+ m_resourceId = resourceId;
+ m_serviceName = serviceName;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getResourceId( )
+ {
+ return m_resourceId;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getServiceName( )
+ {
+ return m_serviceName;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/AbstractBaseFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/AbstractBaseFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/AbstractBaseFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/AbstractBaseFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,383 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource.faults;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.ws.Soap1_1Constants;
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.resource.i18n.Keys;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.resource.impl.UnsupportedVersionException;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.util.XmlBeanNameUtils;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.ws.util.i18n.Messages;
+import org.apache.xmlbeans.XmlObject;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.DetailEntry;
+import java.lang.reflect.Method;
+import java.util.Calendar;
+
+/**
+ * The WS-BaseFaults base fault type implemented as a Java exception.
+ *
+ * @author Ian P. Springer
+ */
+public abstract class AbstractBaseFaultException
+ extends FaultException
+{
+ private static final Messages MSG = MessagesImpl.getInstance( );
+ private static final QName DEFAULT_FAULT_CODE = Soap1_1Constants.FAULT_CLIENT;
+ private Calendar m_timestamp;
+ private EndpointReference m_originator;
+ private ErrorCode m_errorCode;
+ private Description[] m_description;
+ private AbstractBaseFaultException[] m_faultCause;
+ private NamespaceVersionHolder m_namespaceSet;
+ private DetailEntry m_detailEntry;
+
+ /**
+ * Creates a new {@link AbstractBaseFaultException} object.
+ *
+ * @param namespaceSet DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ * @param faultCode DOCUMENT_ME
+ */
+ public AbstractBaseFaultException( NamespaceVersionHolder namespaceSet,
+ String faultString,
+ QName faultCode )
+ {
+ super( faultCode, faultString );
+ m_namespaceSet = namespaceSet;
+ m_timestamp = Calendar.getInstance( );
+ }
+
+ /**
+ * Creates a new {@link AbstractBaseFaultException} object.
+ *
+ * @param namespaceSet DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ */
+ public AbstractBaseFaultException( NamespaceVersionHolder namespaceSet,
+ String faultString )
+ {
+ this( namespaceSet, faultString, DEFAULT_FAULT_CODE );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public abstract QName getBaseFaultName( );
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param description DOCUMENT_ME
+ */
+ public void setDescription( Description[] description )
+ {
+ m_description = description;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Description[] getDescription( )
+ {
+ return m_description;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Detail getDetail( )
+ {
+ updateDetail( );
+ return super.getDetail( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param errorCode DOCUMENT_ME
+ */
+ public void setErrorCode( ErrorCode errorCode )
+ {
+ m_errorCode = errorCode;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ErrorCode getErrorCode( )
+ {
+ return m_errorCode;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param faultCause DOCUMENT_ME
+ */
+ public void setFaultCause( AbstractBaseFaultException[] faultCause )
+ {
+ m_faultCause = faultCause;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public AbstractBaseFaultException[] getFaultCause( )
+ {
+ return m_faultCause;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public NamespaceVersionHolder getNamespaceSet( )
+ {
+ return m_namespaceSet;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param originator DOCUMENT_ME
+ */
+ public void setOriginator( EndpointReference originator )
+ {
+ m_originator = originator;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public EndpointReference getOriginator( )
+ {
+ return m_originator;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param timestamp DOCUMENT_ME
+ */
+ public void setTimestamp( Calendar timestamp )
+ {
+ m_timestamp = timestamp;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Calendar getTimestamp( )
+ {
+ return m_timestamp;
+ }
+
+ /**
+ * Returns a string representation of this exception.
+ *
+ * @return a string representation of this exception
+ */
+ public String toString( )
+ {
+ return new ToStringBuilder( this ).append( MSG.getMessage( Keys.FAULTCODE ),
+ getFaultCode( ) )
+ .append( MSG.getMessage( Keys.FAULTSTRING ),
+ getFaultString( ) )
+ .append( MSG.getMessage( Keys.DESCRIPTION ),
+ m_description )
+ .append( MSG.getMessage( Keys.ERRORCODE ),
+ m_errorCode )
+ .append( MSG.getMessage( Keys.FAULTCAUSE ),
+ m_faultCause ).toString( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public XmlObject toXmlObject( )
+ {
+ if ( m_description == null )
+ {
+ m_description = new Description[]
+ {
+ new Description( getFaultString( ) )
+ };
+ }
+
+ XmlObject baseFaultXBean = createBaseFaultXmlBean( );
+ populateBaseFaultXmlBean( baseFaultXBean );
+ return baseFaultXBean;
+ }
+
+ private XmlObject createBaseFaultXmlBean( )
+ {
+ try
+ {
+ String docFactoryClassName =
+ XmlBeanNameUtils.getDocumentElementXmlBeanFactoryClassName( getBaseFaultName( ) );
+ Class docFactoryClass = Class.forName( docFactoryClassName );
+ Method newInstanceMethod = docFactoryClass.getMethod( "newInstance",
+ new Class[0] );
+ XmlObject docXBean = (XmlObject) newInstanceMethod.invoke( null,
+ new Object[0] );
+ Class docXBeanClass = docXBean.getClass( );
+ Method addNewMethod =
+ docXBeanClass.getMethod( "addNew"
+ + XmlBeanNameUtils.getElementXmlBeanUnqualifiedClassName( getBaseFaultName( ) ),
+ new Class[0] );
+ XmlObject xBean = (XmlObject) addNewMethod.invoke( docXBean,
+ new Object[0] );
+ return xBean;
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Failed to create strongly-typed XmlBean for global element with name "
+ + getBaseFaultName( ), e );
+ }
+ }
+
+ private void populateBaseFaultXmlBean( XmlObject baseFaultXBean )
+ {
+ if ( m_namespaceSet instanceof org.apache.ws.resource.properties.v2004_11.impl.NamespaceVersionHolderImpl )
+ {
+ org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSBaseFaults12Draft03.BaseFaultType baseFaultType =
+ (org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSBaseFaults12Draft03.BaseFaultType) baseFaultXBean;
+ baseFaultType.setTimestamp( m_timestamp );
+ if ( m_description != null )
+ {
+ for ( int i = 0; i < m_description.length; i++ )
+ {
+ org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSBaseFaults12Draft03.BaseFaultType.Description description =
+ baseFaultType.addNewDescription( );
+ description.setStringValue( m_description[i].getValue( ) );
+ if ( m_description[i].getLang( ) != null )
+ {
+ description.setLang( m_description[i].getLang( ) );
+ }
+ }
+ }
+
+ if ( m_errorCode != null )
+ {
+ org.oasisOpen.docs.wsrf.x2004.x11.wsrfWSBaseFaults12Draft03.BaseFaultType.ErrorCode errorCode =
+ baseFaultType.addNewErrorCode( );
+ errorCode.setDialect( m_errorCode.getDialect( ).toString( ) );
+ XmlObject[] elems = m_errorCode.getContent( );
+ for ( int i = 0; i < elems.length; i++ )
+ {
+ XmlBeanUtils.addChildElement( errorCode, elems[i] );
+ }
+ }
+
+ if ( m_faultCause != null )
+ {
+ for ( int i = 0; i < m_faultCause.length; i++ )
+ {
+ XmlBeanUtils.addChildElement( baseFaultType,
+ m_faultCause[i].toXmlObject( ) );
+ }
+ }
+
+ if ( m_originator != null )
+ {
+ // TODO (low priority)
+ }
+ }
+ else if ( m_namespaceSet instanceof org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl )
+ {
+ org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSBaseFaults12Draft01.BaseFaultType baseFaultType =
+ (org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSBaseFaults12Draft01.BaseFaultType) baseFaultXBean;
+ baseFaultType.setTimestamp( m_timestamp );
+ if ( m_description != null )
+ {
+ for ( int i = 0; i < m_description.length; i++ )
+ {
+ org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSBaseFaults12Draft01.BaseFaultType.Description description =
+ baseFaultType.addNewDescription( );
+ description.setStringValue( m_description[i].getValue( ) );
+ if ( m_description[i].getLang( ) != null )
+ {
+ description.setLang( m_description[i].getLang( ) );
+ }
+ }
+ }
+
+ if ( m_errorCode != null )
+ {
+ org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSBaseFaults12Draft01.BaseFaultType.ErrorCode errorCode =
+ baseFaultType.addNewErrorCode( );
+ errorCode.setDialect( m_errorCode.getDialect( ).toString( ) );
+ XmlObject[] elems = m_errorCode.getContent( );
+ for ( int i = 0; i < elems.length; i++ )
+ {
+ XmlBeanUtils.addChildElement( errorCode, elems[i] );
+ }
+ }
+
+ if ( m_faultCause != null )
+ {
+ for ( int i = 0; i < m_faultCause.length; i++ )
+ {
+ XmlBeanUtils.addChildElement( baseFaultType,
+ m_faultCause[i].toXmlObject( ) );
+ }
+ }
+
+ if ( m_originator != null )
+ {
+ // TODO (low priority)
+ }
+ }
+ else
+ {
+ throw new UnsupportedVersionException( m_namespaceSet );
+ }
+ }
+
+ private void updateDetail( )
+ {
+ XmlObject baseFaultDocXBean = toXmlObject( );
+ if ( m_detailEntry != null )
+ {
+ m_detailEntry.detachNode( );
+ }
+
+ m_detailEntry = addDetailEntry( baseFaultDocXBean );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/BaseFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/BaseFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/BaseFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/BaseFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,65 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource.faults;
+
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import javax.xml.namespace.QName;
+
+/**
+ * WS-BaseFaults BaseFault XSD global element implemented as a Java exception.
+ *
+ * @author Ian P. Springer
+ */
+public final class BaseFaultException
+ extends AbstractBaseFaultException
+{
+ /**
+ * Creates a new {@link BaseFaultException} object.
+ *
+ * @param namespaceSet DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ * @param faultCode DOCUMENT_ME
+ */
+ public BaseFaultException( NamespaceVersionHolder namespaceSet,
+ String faultString,
+ QName faultCode )
+ {
+ super( namespaceSet, faultString, faultCode );
+ }
+
+ /**
+ * Constructs a new NewBaseFaultException.
+ *
+ * @param faultString a message describing this fault
+ */
+ public BaseFaultException( NamespaceVersionHolder namespaces,
+ String faultString )
+ {
+ super( namespaces, faultString );
+ }
+
+ /**
+ * Returns the element name for this base fault.
+ *
+ * @return the element name for this base fault
+ */
+ public QName getBaseFaultName( )
+ {
+ return new QName( getNamespaceSet( ).getBaseFaultsXsdNamespace( ),
+ "BaseFault",
+ "wsbf" );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/Description.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/Description.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/Description.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/Description.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,68 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource.faults;
+
+
+/**
+ * The WS-BaseFaults Description type.
+ *
+ * @author Ian P. Springer
+ */
+public class Description
+{
+ private String m_value;
+ private String m_lang;
+
+ /**
+ * Creates a new {@link Description} object.
+ *
+ * @param value DOCUMENT_ME
+ */
+ public Description( String value )
+ {
+ m_value = value;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param lang DOCUMENT_ME
+ */
+ public void setLang( String lang )
+ {
+ m_lang = lang;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getLang( )
+ {
+ return m_lang;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getValue( )
+ {
+ return m_value;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ErrorCode.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ErrorCode.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ErrorCode.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ErrorCode.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,90 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource.faults;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.ws.resource.i18n.Keys;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.util.i18n.Messages;
+import org.apache.xmlbeans.XmlObject;
+import java.net.URI;
+import java.util.Arrays;
+
+/**
+ * The WS-BaseFaults ErrorCode type.
+ *
+ * @author Ian P. Springer
+ */
+public class ErrorCode
+{
+ /** DOCUMENT_ME */
+ public static final Messages MSG = MessagesImpl.getInstance( );
+ private URI m_dialect; // in the XML type, this is a required attribute on the top-level ErrorCode element
+ private XmlObject[] m_content;
+
+ /**
+ * Creates a new ErrorCode with the specified dialect.
+ *
+ * @param dialect DOCUMENT_ME
+ */
+ public ErrorCode( URI dialect )
+ {
+ m_dialect = dialect;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param content DOCUMENT_ME
+ */
+ public void setContent( XmlObject[] content )
+ {
+ m_content = content;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public XmlObject[] getContent( )
+ {
+ return m_content;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public URI getDialect( )
+ {
+ return m_dialect;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String toString( )
+ {
+ return new ToStringBuilder( this ).append( MSG.getMessage( Keys.DIALECT ),
+ m_dialect )
+ .append( MSG.getMessage( Keys.CONTENT ),
+ Arrays.asList( m_content ) ).toString( );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/FaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/FaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/FaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/FaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,144 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource.faults;
+
+import org.apache.ws.util.SaajUtils;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlObject;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.Detail;
+import javax.xml.soap.DetailEntry;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
+/**
+ * Subclass of JAX-RPC {@link SOAPFaultException} that adds convenient methods for
+ * adding Detail entries. The entries may be specified as either DOM nodes or XmlBeans.
+ *
+ * @author Ian P. Springer
+ */
+public class FaultException
+ extends SOAPFaultException
+{
+ private Detail m_detail;
+
+ /**
+ * Creates a new {@link FaultException} object.
+ *
+ * @param faultCode DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ * @param faultActor DOCUMENT_ME
+ * @param detail DOCUMENT_ME
+ */
+ public FaultException( QName faultCode,
+ String faultString,
+ String faultActor,
+ Detail detail )
+ {
+ super( faultCode, faultString, faultActor, detail );
+ m_detail = detail;
+ }
+
+ /**
+ * Creates a new {@link FaultException} object.
+ *
+ * @param faultCode DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ * @param faultActor DOCUMENT_ME
+ */
+ public FaultException( QName faultCode,
+ String faultString,
+ String faultActor )
+ {
+ this( faultCode, faultString, faultActor,
+ createDetail( ) );
+ }
+
+ /**
+ * Creates a new {@link FaultException} object.
+ *
+ * @param faultCode DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ */
+ public FaultException( QName faultCode,
+ String faultString )
+ {
+ this( faultCode, faultString, null );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Detail getDetail( )
+ {
+ return m_detail;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param xmlElem DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public DetailEntry addDetailEntry( XmlObject xmlElem )
+ {
+ XmlObject docXBean = XmlBeanUtils.getDocument( xmlElem );
+ return addDetailEntry( ( (Document) docXBean.newDomNode( ) ).getDocumentElement( ) );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param domElem DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public DetailEntry addDetailEntry( Element domElem )
+ {
+ if ( m_detail == null )
+ {
+ throw new IllegalStateException( "Detail entry cannot be added because Detail is null." );
+ }
+
+ try
+ {
+ return SaajUtils.addDetailEntry( m_detail, domElem );
+ }
+ catch ( SOAPException soape )
+ {
+ throw new JAXRPCException( "Failed to add detail entry to SAAJ Detail object.", soape );
+ }
+ }
+
+ private static Detail createDetail( )
+ {
+ try
+ {
+ return SOAPFactory.newInstance( ).createDetail( );
+ }
+ catch ( SOAPException soape )
+ {
+ throw new JAXRPCException( "Failed to create SAAJ Detail object via SOAPFactory.", soape );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ResourceKeyHeaderNotFoundFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ResourceKeyHeaderNotFoundFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ResourceKeyHeaderNotFoundFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/resource/faults/ResourceKeyHeaderNotFoundFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,47 @@
+/*=============================================================================*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * 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.apache.ws.resource.faults;
+
+import org.apache.ws.Soap1_1Constants;
+import org.apache.ws.resource.i18n.Keys;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.util.i18n.Messages;
+import javax.xml.namespace.QName;
+
+/**
+ * A fault that is thrown when the expected resource identifier header element
+ * is not found in a SOAP request Header. The name of the header element that
+ * is expected for a particular type of resource is configured via the
+ * resourceKeyName parameter for that resource's home in the Apache WSRF
+ * JNDI configuration file.
+ */
+public class ResourceKeyHeaderNotFoundFaultException
+ extends FaultException
+{
+ private static final Messages MSG = MessagesImpl.getInstance( );
+
+ /**
+ * Creates a new {@link ResourceKeyHeaderNotFoundFaultException} object.
+ *
+ * @param expectedHeaderName DOCUMENT_ME
+ */
+ public ResourceKeyHeaderNotFoundFaultException( QName expectedHeaderName )
+ {
+ super( Soap1_1Constants.FAULT_CLIENT,
+ MSG.getMessage( Keys.EXPECTED_ADDRESSING_HEADER,
+ String.valueOf( expectedHeaderName ) ) );
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org