Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/resource
In directory sc8-pr-cvs1:/tmp/cvs-serv700/src/com/babeldoc/core/resource
Modified Files:
IResource.java Resource.java ResourceException.java
ResourceFactory.java ResourceType.java
Log Message:
reformatted and updated license header
Index: IResource.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/resource/IResource.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** IResource.java 15 Mar 2003 22:54:11 -0000 1.2
--- IResource.java 27 Jun 2003 02:19:59 -0000 1.3
***************
*** 1,51 ****
! /*
! * $Header$
! * $DateTime: 2002/07/21 17:01:20 $
*
*
! * babeldoc: universal document processor
*
! * This program is free software; you can redistribute it and/or
! * modify it under the terms of the GNU General Public License
! * as published by the Free Software Foundation; either version 2
! * of the License, or (at your option) any later version.
*
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.babeldoc.core.resource;
-
/**
! * Interface for connection managers. Primarily to be used by connection pools etc.
! *
! * CONTRACT: The setName method will be called with a non-null string (the name of this
! * resource) before any connections are manipulated. This is essential to the health and
! * sanity of the system.
*
* @author Bmcdonald
* @version 1.0
*/
! public interface IResource
! extends com.babeldoc.core.INamed {
!
/**
! * Check out a connection from this manager.
! * @return the checked out connection
*/
! public Object checkOut()
! throws ResourceException;
/**
! * Check back in a checked out connection
! * @param object
*/
! public void checkIn(Object object)
! throws ResourceException;
! }
\ No newline at end of file
--- 1,91 ----
! /* ====================================================================
! * The Apache Software License, Version 1.1
*
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
*
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
*
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Apache" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact ap...@ap....
! *
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
! *
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
! *
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
! *
! * Portions of this software are based upon public domain software
! * originally written at the National Center for Supercomputing Applications,
! * University of Illinois, Urbana-Champaign.
! * ====================================================================
! *
! * Babeldoc: The Universal Document Processor
! *
! * $Header$
! * $DateTime$
! * $Author$
*
*/
package com.babeldoc.core.resource;
/**
! * Interface for connection managers. Primarily to be used by connection pools
! * etc. CONTRACT: The setName method will be called with a non-null string
! * (the name of this resource) before any connections are manipulated. This
! * is essential to the health and sanity of the system.
*
* @author Bmcdonald
* @version 1.0
*/
! public interface IResource extends com.babeldoc.core.INamed {
/**
! * Check back in a checked out connection
! *
! * @param object
*/
! public void checkIn(Object object) throws ResourceException;
/**
! * Check out a connection from this manager.
! *
! * @return the checked out connection
*/
! public Object checkOut() throws ResourceException;
! }
Index: Resource.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/resource/Resource.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Resource.java 8 Apr 2003 02:34:08 -0000 1.4
--- Resource.java 27 Jun 2003 02:19:59 -0000 1.5
***************
*** 1,22 ****
! /*
! * $Header$
! * $DateTime: 2002/07/21 17:01:20 $
*
*
! * babeldoc: universal document processor
*
! * This program is free software; you can redistribute it and/or
! * modify it under the terms of the GNU General Public License
! * as published by the Free Software Foundation; either version 2
! * of the License, or (at your option) any later version.
*
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.babeldoc.core.resource;
--- 1,66 ----
! /* ====================================================================
! * The Apache Software License, Version 1.1
*
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
*
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
*
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Apache" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact ap...@ap....
! *
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
! *
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
! *
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
! *
! * Portions of this software are based upon public domain software
! * originally written at the National Center for Supercomputing Applications,
! * University of Illinois, Urbana-Champaign.
! * ====================================================================
! *
! * Babeldoc: The Universal Document Processor
! *
! * $Header$
! * $DateTime$
! * $Author$
*
*/
package com.babeldoc.core.resource;
***************
*** 25,28 ****
--- 69,73 ----
import com.babeldoc.core.config.IConfig;
+
/**
* Most elementary implementer of IResource - abstract in fact, just to handle
***************
*** 32,58 ****
* @version 1.0
*/
!
! public abstract class Resource
! extends com.babeldoc.core.Named
implements IResource {
!
! /**
! * Constants - will move to confserver when needs to be done.
! */
public static String CONFIG_FILENAME = "resource/";
! /**
! * Configuration stuff
! */
private IConfig config;
/**
* Get the config object
*/
protected IConfig getConfig() {
if (config == null) {
! config = ConfigService.getInstance().
! getConfig(CONFIG_FILENAME + getName());
}
return config;
}
--- 77,99 ----
* @version 1.0
*/
! public abstract class Resource extends com.babeldoc.core.Named
implements IResource {
! /** Constants - will move to confserver when needs to be done. */
public static String CONFIG_FILENAME = "resource/";
! /** Configuration stuff */
private IConfig config;
/**
* Get the config object
+ *
+ * @return DOCUMENT ME!
*/
protected IConfig getConfig() {
if (config == null) {
! config = ConfigService.getInstance().getConfig(CONFIG_FILENAME +
! getName());
}
+
return config;
}
Index: ResourceException.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/resource/ResourceException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ResourceException.java 15 Mar 2003 22:54:11 -0000 1.2
--- ResourceException.java 27 Jun 2003 02:19:59 -0000 1.3
***************
*** 1,35 ****
! /*
! * $Header$
! * $DateTime: 2002/07/21 17:01:20 $
*
*
! * babeldoc: universal document processor
*
! * This program is free software; you can redistribute it and/or
! * modify it under the terms of the GNU General Public License
! * as published by the Free Software Foundation; either version 2
! * of the License, or (at your option) any later version.
*
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.babeldoc.core.resource;
-
/**
! * Deliverer of (bad) news related to resource issues. Read the err log messages.
*
* @author Bmcdonald
* @version 1.0
*/
! public class ResourceException
! extends com.babeldoc.core.GeneralException {
!
/**
* Constructor
--- 1,77 ----
! /* ====================================================================
! * The Apache Software License, Version 1.1
*
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
*
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
*
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Apache" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact ap...@ap....
! *
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
! *
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
! *
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
! *
! * Portions of this software are based upon public domain software
! * originally written at the National Center for Supercomputing Applications,
! * University of Illinois, Urbana-Champaign.
! * ====================================================================
! *
! * Babeldoc: The Universal Document Processor
! *
! * $Header$
! * $DateTime$
! * $Author$
*
*/
package com.babeldoc.core.resource;
/**
! * Deliverer of (bad) news related to resource issues. Read the err log
! * messages.
*
* @author Bmcdonald
* @version 1.0
*/
! public class ResourceException extends com.babeldoc.core.GeneralException {
/**
* Constructor
Index: ResourceFactory.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/resource/ResourceFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ResourceFactory.java 22 May 2003 03:20:29 -0000 1.4
--- ResourceFactory.java 27 Jun 2003 02:19:59 -0000 1.5
***************
*** 1,24 ****
! /*
! * $Header$
! * $DateTime: 2002/07/21 17:01:20 $
*
*
! * babeldoc: universal document processor
*
! * This program is free software; you can redistribute it and/or
! * modify it under the terms of the GNU General Public License
! * as published by the Free Software Foundation; either version 2
! * of the License, or (at your option) any later version.
*
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
package com.babeldoc.core.resource;
--- 1,67 ----
! /* ====================================================================
! * The Apache Software License, Version 1.1
*
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
*
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
*
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Apache" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact ap...@ap....
! *
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
! *
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
! *
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
! *
! * Portions of this software are based upon public domain software
! * originally written at the National Center for Supercomputing Applications,
! * University of Illinois, Urbana-Champaign.
! * ====================================================================
! *
! * Babeldoc: The Universal Document Processor
! *
! * $Header$
! * $DateTime$
! * $Author$
*
*/
package com.babeldoc.core.resource;
***************
*** 26,29 ****
--- 69,73 ----
import com.babeldoc.core.LogService;
import com.babeldoc.core.config.ConfigService;
+
import org.apache.commons.collections.LRUMap;
***************
*** 31,54 ****
import java.util.Map;
/**
* Resource factory finds named resources. Looks in the classpath for the
! * classname of the named resource and instantiates it. The guts of the processing
! * individual resources. For now resource can be checked in or out - thats it. more
! * later.
*
* @author Bmcdonald
* @version 1.0
*/
-
public class ResourceFactory {
! public final static int NUM_LRU = 100;
! /** constants for the configuration stuff */
! public final static String TYPE = "type";
! public final static String RESOURCE = "resource";
! /**
! * holds singleton reference
! */
private static ResourceFactory instance = new ResourceFactory();
--- 75,96 ----
import java.util.Map;
+
/**
* Resource factory finds named resources. Looks in the classpath for the
! * classname of the named resource and instantiates it. The guts of the
! * processing individual resources. For now resource can be checked in or out
! * - thats it. more later.
*
* @author Bmcdonald
* @version 1.0
*/
public class ResourceFactory {
! public static final int NUM_LRU = 100;
! /** constants for the configuration stuff */
! public static final String TYPE = "type";
! public static final String RESOURCE = "resource";
! /** holds singleton reference */
private static ResourceFactory instance = new ResourceFactory();
***************
*** 57,65 ****
/**
! * Constructor is private since this is a singleton. This
! * constructor sets up the resources.
*/
private ResourceFactory() {
! /** Scanner configuration */
resources = Collections.synchronizedMap(new LRUMap(NUM_LRU));
}
--- 99,109 ----
/**
! * Constructor is private since this is a singleton. This constructor sets
! * up the resources.
*/
private ResourceFactory() {
! /**
! * Scanner configuration
! */
resources = Collections.synchronizedMap(new LRUMap(NUM_LRU));
}
***************
*** 75,93 ****
/**
! * Get a named resource object. Must be synchronized to disallow the access and possible
! * creation of a new resource
*
* @return the sqlconnectionmanager object
*/
! public synchronized static IResource getResource(String name) {
// LogService.getInstance().logDebug("[ResourceFactory.getResource]: getting resource \""+name+"\"");
IResource resource = (IResource) getInstance().resources.get(name);
if (resource == null) {
// LogService.getInstance().logDebug("[ResourceFactory.getResource] resource not cached, creating");
try {
String typeName = ConfigService.getString(RESOURCE + "/" + name, TYPE);
// LogService.getInstance().logDebug("[ResourceFactory.getResource]: Type: \""+typeName+"\"");
if (typeName != null) {
Class classObj = ResourceType.getResourceType(typeName).getTypeClass();
if (classObj != null) {
resource = (Resource) classObj.newInstance();
--- 119,142 ----
/**
! * Get a named resource object. Must be synchronized to disallow the access
! * and possible creation of a new resource
! *
! * @param name DOCUMENT ME!
*
* @return the sqlconnectionmanager object
*/
! public static synchronized IResource getResource(String name) {
// LogService.getInstance().logDebug("[ResourceFactory.getResource]: getting resource \""+name+"\"");
IResource resource = (IResource) getInstance().resources.get(name);
+
if (resource == null) {
// LogService.getInstance().logDebug("[ResourceFactory.getResource] resource not cached, creating");
try {
String typeName = ConfigService.getString(RESOURCE + "/" + name, TYPE);
+
// LogService.getInstance().logDebug("[ResourceFactory.getResource]: Type: \""+typeName+"\"");
if (typeName != null) {
Class classObj = ResourceType.getResourceType(typeName).getTypeClass();
+
if (classObj != null) {
resource = (Resource) classObj.newInstance();
***************
*** 104,108 ****
}
}
return resource;
}
! }
\ No newline at end of file
--- 153,158 ----
}
}
+
return resource;
}
! }
Index: ResourceType.java
===================================================================
RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/resource/ResourceType.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ResourceType.java 8 Apr 2003 00:01:05 -0000 1.3
--- ResourceType.java 27 Jun 2003 02:19:59 -0000 1.4
***************
*** 1,22 ****
! /*
! * $Header$
! * $DateTime: 2002/07/21 17:01:20 $
*
*
! * babeldoc: universal document processor
*
! * This program is free software; you can redistribute it and/or
! * modify it under the terms of the GNU General Public License
! * as published by the Free Software Foundation; either version 2
! * of the License, or (at your option) any later version.
*
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.babeldoc.core.resource;
--- 1,66 ----
! /* ====================================================================
! * The Apache Software License, Version 1.1
*
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
*
! * Redistribution and use in source and binary forms, with or without
! * modification, are permitted provided that the following conditions
! * are met:
*
! * 1. Redistributions of source code must retain the above copyright
! * notice, this list of conditions and the following disclaimer.
*
! * 2. Redistributions in binary form must reproduce the above copyright
! * notice, this list of conditions and the following disclaimer in
! * the documentation and/or other materials provided with the
! * distribution.
! *
! * 3. The end-user documentation included with the redistribution,
! * if any, must include the following acknowledgment:
! * "This product includes software developed by the
! * Apache Software Foundation (http://www.apache.org/)."
! * Alternately, this acknowledgment may appear in the software itself,
! * if and wherever such third-party acknowledgments normally appear.
! *
! * 4. The names "Apache" and "Apache Software Foundation" must
! * not be used to endorse or promote products derived from this
! * software without prior written permission. For written
! * permission, please contact ap...@ap....
! *
! * 5. Products derived from this software may not be called "Apache",
! * nor may "Apache" appear in their name, without prior written
! * permission of the Apache Software Foundation.
! *
! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
! * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! * SUCH DAMAGE.
! * ====================================================================
! *
! * This software consists of voluntary contributions made by many
! * individuals on behalf of the Apache Software Foundation. For more
! * information on the Apache Software Foundation, please see
! * <http://www.apache.org/>.
! *
! * Portions of this software are based upon public domain software
! * originally written at the National Center for Supercomputing Applications,
! * University of Illinois, Urbana-Champaign.
! * ====================================================================
! *
! * Babeldoc: The Universal Document Processor
! *
! * $Header$
! * $DateTime$
! * $Author$
*
*/
package com.babeldoc.core.resource;
***************
*** 24,55 ****
import com.babeldoc.core.Type;
/**
! * Characterize the type of resource. This type maps to a name and a class to actually
! * provide a concrete implementation.
! *
! * TODO: Implement this in terms of Type
*
* @author Bmcdonald
* @version 1.0
*/
! public class ResourceType
! extends Type {
! /**
! * Service prefix
! */
public static String SERVICE_PREFIX = "Resource";
-
- /**
- * Get the service prefix for this type.
- *
- * @return
- */
- public String getServicePrefix() {
- return SERVICE_PREFIX;
- }
-
/**
* Private constructor - do not use this - use the constants above.
*/
private ResourceType(String resourceType) {
--- 68,88 ----
import com.babeldoc.core.Type;
+
/**
! * Characterize the type of resource. This type maps to a name and a class to
! * actually provide a concrete implementation. TODO: Implement this in terms
! * of Type
*
* @author Bmcdonald
* @version 1.0
*/
! public class ResourceType extends Type {
! /** Service prefix */
public static String SERVICE_PREFIX = "Resource";
/**
* Private constructor - do not use this - use the constants above.
+ *
+ * @param resourceType DOCUMENT ME!
*/
private ResourceType(String resourceType) {
***************
*** 61,68 ****
--- 94,111 ----
*
* @param resourceType
+ *
* @return
*/
public static ResourceType getResourceType(String resourceType) {
return new ResourceType(resourceType);
+ }
+
+ /**
+ * Get the service prefix for this type.
+ *
+ * @return
+ */
+ public String getServicePrefix() {
+ return SERVICE_PREFIX;
}
}
|