Author: ozeigermann Date: Mon Jul 23 12:17:55 2007 New Revision: 558836 URL: http://svn.apache.org/viewvc?view=rev&rev=558836 Log: Cleaning of resource interfaces after first practical experience with an implementation: - Some methods had weird return types: removed - Foreign Exceptions replaced in favor of ResourceException
Added: jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java Modified: jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceManager.java jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/StreamableResource.java Added: jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java?view=auto&rev=558836 ============================================================================== --- jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java (added) +++ jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceException.java Mon Jul 23 12:17:55 2007 @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.commons.transaction.resource; + +public class ResourceException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 7650329971392401844L; + + public ResourceException(String message, Throwable cause) { + super(message, cause); + } + + public ResourceException(Throwable cause) { + super(cause); + } + public ResourceException(String message) { + super(message); + } + +} Modified: jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceManager.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceManager.java?view=diff&rev=558836&r1=558835&r2=558836 ============================================================================== --- jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceManager.java (original) +++ jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/ResourceManager.java Mon Jul 23 12:17:55 2007 @@ -16,16 +16,14 @@ */ package org.apache.commons.transaction.resource; -import java.io.IOException; - -import org.apache.commons.transaction.locking.LockException; public interface ResourceManager<R> { - R getResource(String path) throws IOException, LockException; - - String getRootPath() throws IOException, LockException; + R getResource(String path) throws ResourceException; + String getRootPath(); +/* void addInterceptor(ResourceInterceptor interceptor); void removeInterceptor(ResourceInterceptor interceptor); + */ } Modified: jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/StreamableResource.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/StreamableResource.java?view=diff&rev=558836&r1=558835&r2=558836 ============================================================================== --- jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/StreamableResource.java (original) +++ jakarta/commons/proper/transaction/branches/TRANSACTION_2/src/java/org/apache/commons/transaction/resource/StreamableResource.java Mon Jul 23 12:17:55 2007 @@ -16,46 +16,43 @@ */ package org.apache.commons.transaction.resource; -import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.Collection; - -import org.apache.commons.transaction.locking.LockException; +import java.util.List; public interface StreamableResource { - String getPath(); + String getPath() throws ResourceException ; boolean isDirectory(); boolean isFile(); - Collection<StreamableResource> getChildren() throws IOException, LockException; + List<StreamableResource> getChildren() throws ResourceException; - StreamableResource getParent() throws IOException, LockException; + StreamableResource getParent() throws ResourceException; - InputStream readStream() throws IOException, LockException; + InputStream readStream() throws ResourceException; - OutputStream writeStream(boolean append) throws IOException, LockException; + OutputStream writeStream(boolean append) throws ResourceException; - boolean delete() throws IOException, LockException; + void delete() throws ResourceException; - boolean move(String destinationpath) throws IOException, LockException; + void move(String destinationpath) throws ResourceException; - boolean copy(String destinationpath) throws IOException, LockException; + void copy(String destinationpath) throws ResourceException; boolean exists(); - void createAsDirectory() throws IOException, LockException; + void createAsDirectory() throws ResourceException; - void createAsFile() throws IOException, LockException; + void createAsFile() throws ResourceException; // plus more general properties // among them could be length, lastmodfied, etc. Object getProperty(String name); - Object setProperty(String name, Object newValue); - Object removeProperty(String name); + void setProperty(String name, Object newValue); + void removeProperty(String name); // plus locking methods void readLock(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]