|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| DatabaseImpl.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | * | |
| 17 | * $Id: DatabaseImpl.java 541508 2007-05-25 01:54:12Z vgritsenko $ | |
| 18 | */ | |
| 19 | ||
| 20 | package org.apache.xindice.client.xmldb.managed; | |
| 21 | ||
| 22 | import org.apache.xindice.client.xmldb.CommonConfigurable; | |
| 23 | ||
| 24 | /** | |
| 25 | * The xindice-managed is a xindice client driver that requires third party code | |
| 26 | * to create the database within the constraints of the client classloader. Typically | |
| 27 | * it is used in embedded environments where database creation is managed by the third | |
| 28 | * party code. | |
| 29 | * | |
| 30 | * This driver will throw an exception if the database instance you are trying to access | |
| 31 | * hasn't been registered. | |
| 32 | * | |
| 33 | * @author <a href="mailto:kevin@rocketred.com.au">Kevin O'Neill</a> | |
| 34 | * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a> | |
| 35 | * @version $Revision: 541508 $, $Date: 2007-05-24 18:54:12 -0700 (Thu, 24 May 2007) $ | |
| 36 | */ | |
| 37 | public class DatabaseImpl extends org.apache.xindice.client.xmldb.embed.DatabaseImpl { | |
| 38 | ||
| 39 | /** | |
| 40 | * Prefix used to denote XML:DB URI's that should use this driver | |
| 41 | */ | |
| 42 | public static final String DRIVER_NAME = "xindice-managed"; | |
| 43 | ||
| 44 | ||
| 45 | /** | |
| 46 | * Creates new <code>DatabaseImpl</code> instance. | |
| 47 | */ | |
| 48 | 0 | public DatabaseImpl() { |
| 49 | 0 | super(); |
| 50 | } | |
| 51 | ||
| 52 | /** | |
| 53 | * Create a new DatabaseImpl object with a copy of the properties | |
| 54 | * from the <code>config</code> parameter. | |
| 55 | * | |
| 56 | * This allows to pass properties such as PROP_XINDICE_CONFIGURATION | |
| 57 | * to this instance. Usually this is done by instantiating not this | |
| 58 | * class, but {@link org.apache.xindice.client.xmldb.DatabaseImpl}, | |
| 59 | * set all the necessary parameters, and then get a collection. | |
| 60 | * | |
| 61 | * @param config from which the initial parameters for this | |
| 62 | * DatabaseImpl object are copied. | |
| 63 | */ | |
| 64 | 0 | public DatabaseImpl(CommonConfigurable config) { |
| 65 | 0 | super(config); |
| 66 | } | |
| 67 | ||
| 68 | /** | |
| 69 | * @return true | |
| 70 | */ | |
| 71 | 0 | protected boolean isManaged() { |
| 72 | 0 | return true; |
| 73 | } | |
| 74 | ||
| 75 | 0 | public boolean acceptsURI(String uri) { |
| 76 | 0 | return ((uri != null) && uri.startsWith(getName() + "://")); |
| 77 | } | |
| 78 | ||
| 79 | /* (non-Javadoc) | |
| 80 | * @see org.xmldb.api.base.Database#getName() | |
| 81 | */ | |
| 82 | 0 | public String getName() { |
| 83 | 0 | return DRIVER_NAME; |
| 84 | } | |
| 85 | ||
| 86 | /* (non-Javadoc) | |
| 87 | * @see org.xmldb.api.base.Database#getNames() | |
| 88 | */ | |
| 89 | 0 | public String[] getNames() { |
| 90 | 0 | return new String[]{ DRIVER_NAME }; |
| 91 | } | |
| 92 | } |
|
||||||||||