
com.adaptrex.core.Adaptrex Maven / Gradle / Ivy
/*
* Copyright 2012 Adaptrex, LLC.
*
* 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 com.adaptrex.core;
//import org.apache.log4j.Logger;
import com.adaptrex.core.persistence.api.ORMPersistenceManager;
import com.adaptrex.core.rest.RestService;
/**
* An instance of this class is the main entry point into Adaptrex services. Your webapp
* needs to bootstrap Adaptrex before it can be used. For
* more information on bootstrapping, see {@link AdaptrexContextListener AdaptrexContextListener}
*
* In general, most interactions with Adaptrex use the following:
*
* - Built in presentation components (JSF, JSP, Tapestry, etc)
* - Store and Model CRUD methods (REST API)
*
* In those cases, you do not need to access the Adaptrex service directly. If you do
* need access to some services (such as AdaptrexPersistence) you can retrieve them directly
* from the Adaptrex service instance. You can always retrieve the service by calling
* Adaptrex.getAdaptrex() or by whatever other mechanism you have enabled in your application
*/
public class Adaptrex {
//private Logger log = Logger.getLogger(Adaptrex.class);
public Adaptrex() {}
public ORMPersistenceManager getPersistenceManager() {
return AdaptrexRegistry.getPersistenceManager();
}
public ORMPersistenceManager getPersistenceManager(String factoryName) {
return AdaptrexRegistry.getPersistenceManager(factoryName);
}
public RestService getRest() {
return AdaptrexRegistry.getRestService();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy