Package org.apache.muse.core.descriptor

Source Code of org.apache.muse.core.descriptor.PersistenceDefinition

/*=============================================================================*
*  Copyright 2006 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.muse.core.descriptor;

import java.util.Map;

import org.apache.muse.core.Persistence;
import org.apache.muse.util.ReflectUtils;

/**
*
* @author Dan Jemiolo (danj)
*
*/

public class PersistenceDefinition
{
    private Map _parameters = null;
   
    private Class _persistenceClass = null;
   
    private String _persistenceLocation = null;

    public Map getInitializationParameters()
    {
        return _parameters;
    }

    public Class getPersistenceClass()
    {
        return _persistenceClass;
    }
   
    public String getPersistenceLocation()
    {
        return _persistenceLocation;
    }

    public Persistence newInstance()
    {
        Persistence persistence = (Persistence)ReflectUtils.newInstance(getPersistenceClass());
        persistence.setPersistenceLocation(getPersistenceLocation());
        return persistence;
    }

    public void setInitializationParameters(Map parameters)
    {
        _parameters = parameters;
    }

    public void setPersistenceClass(Class persistenceClass)
    {
        _persistenceClass = persistenceClass;
    }

    public void setPersistenceLocation(String persistenceLocation)
    {
        _persistenceLocation = persistenceLocation;
    }
}
TOP

Related Classes of org.apache.muse.core.descriptor.PersistenceDefinition

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.