All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cogchar.bind.mio.repo.RepoClientLifecycle Maven / Gradle / Ivy

The newest version!
/*
 *  Copyright 2013 by The Cogchar Project (www.cogchar.org).
 * 
 *  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.cogchar.bind.mio.repo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.appdapter.fancy.rclient.RepoClient;
import org.appdapter.fancy.rclient.LocalRepoClientImpl;
import org.appdapter.fancy.repo.FancyRepo;

import org.jflux.impl.services.rk.lifecycle.AbstractLifecycleProvider;
import org.jflux.impl.services.rk.lifecycle.DependencyDescriptor;


/**
 * @author Stu B. 
 * 
 * Provides a RepoClient based on some Repo which is either local or remote.
 */

public class RepoClientLifecycle extends AbstractLifecycleProvider  {
	private		String myQueryTargetVarName;
	private		String myQuerySheetQN;
	
	public RepoClientLifecycle(		String queryTargetVarName, String querySheetQN)	 {
		super(buildDescriptorList(queryTargetVarName, querySheetQN));
		myQueryTargetVarName = queryTargetVarName;
		myQuerySheetQN = querySheetQN;
	}
    private static List buildDescriptorList(String queryTargetVarName, String querySheetQN){

        List descriptors = new ArrayList();
		/*        for(String uri : chanURIs){
            descriptors.add(new DependencyDescriptor(uri, Channel.class, 
                    OSGiUtils.createFilter("URI", uri), DependencyDescriptor.DependencyType.REQUIRED));		*/ 
		return descriptors;
	}
	@Override protected RepoClient create(Map map) {
		FancyRepo	fancyRepo = null;
		RepoClient rc = new LocalRepoClientImpl(fancyRepo, myQueryTargetVarName, myQuerySheetQN)	;
		return rc;	
	}

	@Override protected void handleChange(String string, Object o, Map map) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

	@Override protected Class getServiceClass() {
		return RepoClient.class;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy