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

org.jflux.spec.services.ServiceBindingSpec Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package org.jflux.spec.services;

import java.util.HashMap;
import java.util.Map;
import org.appdapter.bind.rdf.jena.assembly.KnownComponentImpl;
import org.jflux.api.registry.Descriptor;
import org.jflux.api.registry.basic.BasicDescriptor;
import org.jflux.api.service.binding.ServiceBinding.BindingStrategy;

/**
 * The data object for the dependency binding properties of a service.
 *
 * @author Jason Randolph Eads 
 * @author Amy Jessica Book 
 */

public class ServiceBindingSpec extends KnownComponentImpl {
    // The stored data definitions
    
    private String myClassName;
    private Map myProperties;
    private ServiceDependencySpec myServiceDependency;
    private BindingStrategy myBindingStrategy;
    
    public ServiceBindingSpec() {
        myProperties = new HashMap();
    }
    
    // Getters for data
    
    public ServiceDependencySpec getServiceDependency() {
        return myServiceDependency;
    }
    
    public Descriptor getDescriptor() {
        return new BasicDescriptor(myClassName, myProperties);
    }
    
    public BindingStrategy getBindingStrategy() {
        return myBindingStrategy;
    }
    
    // Setters for data
    
    public void setClassName(String className) {
        myClassName = className;
    }
    
    public void setBindingStrategy(BindingStrategy bindingStrategy) {
        myBindingStrategy = bindingStrategy;
    }
    
    public void setServiceDependency(ServiceDependencySpec serviceDependency) {
        myServiceDependency = serviceDependency;
    }
    
    // Accumulators for data
    
    public void addProperty(String key, String value) {
        myProperties.put(key, value);
     }
     
    public void removeProperty(String key) {
        myProperties.remove(key);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy