当前位置: 首页>>代码示例>>Java>>正文


Java Configuration类代码示例

本文整理汇总了Java中org.apache.taverna.scufl2.api.configurations.Configuration的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Configuration类属于org.apache.taverna.scufl2.api.configurations包,在下文中一共展示了Configuration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addNewProvider

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
protected void addNewProvider(Configuration configurationBean) {
	ConfigurableServiceProvider cloned = (ConfigurableServiceProvider) confProvider
			.newInstance();
	try {
		cloned.configure(configurationBean);
		getServiceDescriptionRegistry().addObserver(
				new CheckAddedCorrectlyObserver(cloned));
		getServiceDescriptionRegistry().addServiceDescriptionProvider(
				cloned);
	} catch (Exception ex) {
		logger.warn("Can't configure provider " + cloned + " using "
				+ configurationBean, ex);
		showMessageDialog(owner, "Can't configure service provider "
				+ cloned.getName(), "Can't add service provider",
				ERROR_MESSAGE);
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:18,代码来源:AddServiceProviderAction.java

示例2: defineEditsForConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
private void defineEditsForConfiguration(Workflow workflow,
		OutputWorkflowPort port, WorkflowBundle workflowBundle,
		Activity activity, Configuration c) {
	List<Edit<?>> edits = nestedPortEdit.getChildEdits();
	JsonNode nested = c.getJson().get("nestedWorkflow");
	Workflow nestedWorkflow = workflowBundle.getWorkflows().getByName(
			nested.asText());
	if (nestedWorkflow != workflow)
		return;

	OutputActivityPort activityPort = activity.getOutputPorts().getByName(
			port.getName());
	edits.add(new RemoveChildEdit<>(activity, activityPort));
	for (ProcessorBinding processorBinding : scufl2Tools
			.processorBindingsToActivity(activity))
		for (ProcessorOutputPortBinding portBinding : processorBinding
				.getOutputPortBindings())
			if (portBinding.getBoundActivityPort() == activityPort) {
				OutputProcessorPort processorPort = portBinding
						.getBoundProcessorPort();
				edits.add(new RemoveProcessorOutputPortEdit(
						processorBinding.getBoundProcessor(), processorPort));
				edits.add(new RemoveChildEdit<>(processorBinding,
						portBinding));
			}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:27,代码来源:RemoveWorkflowOutputPortEdit.java

示例3: initialise

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
private void initialise() {
	if (panel == null) {
		panel = createPanel();
	} else {
		panel.removeAll();
	}

	JTextArea textArea = new ReadOnlyTextArea();
	textArea.setEditable(false);
	String maxJobs = "1";
	for (Configuration configuration : scufl2Tools.configurationsFor(processor, selectionManager.getSelectedProfile())) {
		JsonNode processorConfig = configuration.getJson();
		if (processorConfig.has("parallelize")) {
			JsonNode parallelizeConfig = processorConfig.get("parallelize");
			if (parallelizeConfig.has("maximumJobs")) {
				maxJobs = parallelizeConfig.get("maximumJobs").asText();
			}
		}
	}
	textArea.setText("The maximum number of jobs is " + maxJobs);
	textArea.setBackground(panel.getBackground());
	panel.add(textArea, BorderLayout.CENTER);
	revalidate();
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:25,代码来源:ParallelizeContextualView.java

示例4: testCompletenessOfSpecifiedConfigurations

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
@Test
public void testCompletenessOfSpecifiedConfigurations() {
	DummyProfile profile = new DummyProfile();
	// The fields will default to null
	profile.setConfigurations(new NamedSet<Configuration>());
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(profile, true, rcvl);
	
	Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
	boolean problem = false;
	for (NullFieldProblem nlp : nullFieldProblems) {
		if (nlp.getBean().equals(profile) && nlp.getFieldName().equals("configurations")) {
			problem = true;
		}
	}
	assertFalse(problem);
	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:22,代码来源:TestProfile.java

示例5: testIdenticalConfigurableTypes

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
@Test
public void testIdenticalConfigurableTypes() {
	Configuration configuration = new Configuration();
	Activity a = new Activity();
	URI tavernaUri = null;
	try {
		tavernaUri = new URI("http://www.taverna.org.uk");
	} catch (URISyntaxException e) {
		return;
	}
	configuration.setConfigures(a);
	configuration.setType(tavernaUri);
	a.setType(tavernaUri);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(configuration, false, rcvl);
	
	Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
	assertEquals(0, mismatchConfigurableTypeProblems.size());
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:23,代码来源:TestConfiguration.java

示例6: testEqualConfigurableTypes

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
@Ignore
public void testEqualConfigurableTypes() {
	Configuration configuration = new Configuration();
	Activity a = new Activity();
	URI tavernaUri = null;
	URI tavernaUri2 = null;
	try {
		tavernaUri = new URI("http://www.taverna.org.uk");
		tavernaUri2 = new URI("http://www.taverna.org.uk");
	} catch (URISyntaxException e) {
		return;
	}
	configuration.setConfigures(a);
	configuration.setType(tavernaUri);
	a.setType(tavernaUri2);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(configuration, false, rcvl);
	
	Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
	assertEquals(0, mismatchConfigurableTypeProblems.size());
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:TestConfiguration.java

示例7: testCompletenessOfMissingConfigures

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
@Test
public void testCompletenessOfMissingConfigures() {
	Configuration configuration = new Configuration();
       configuration.setType(URI.create("http://www.example.com/"));
       configuration.setJson("{ \"hello\": 1337  }");
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(configuration, true, rcvl);
	
	Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
	assertFalse(nullFieldProblems.isEmpty()); // only done when completeness check
	
	boolean fieldProblem = false;
	for (NullFieldProblem nlp : nullFieldProblems) {
		if (nlp.getBean().equals(configuration) && nlp.getFieldName().equals("configures")) {
			fieldProblem = true;
		}
	}
	assertTrue(fieldProblem);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:23,代码来源:TestConfiguration.java

示例8: configurationNotAddedTwice

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
/**
 * Similar bug to {@link DataLinkCompareTest#dataLinkNotAddedTwice()}
 */
@Test
public void configurationNotAddedTwice() throws Exception {
	Configuration c1a = new Configuration("c1");
	Profile p1 = new Profile("p1");
	p1.getConfigurations().add(c1a);		
	c1a.setParent(p1);
	p1.getConfigurations().add(c1a);
	
	
	Configuration c1b = new Configuration("c1");
	Profile p2 = new Profile("p2");
	p2.getConfigurations().add(c1b);		
	c1b.setParent(p2);
	p2.getConfigurations().add(c1b);
	
	
	WorkflowBundle bundle = new WorkflowBundle();
	p1.setParent(bundle);
	p2.setParent(bundle);
	new Scufl2Tools().setParents(bundle);
	assertEquals(1, p1.getConfigurations().size());
	assertEquals(1, p2.getConfigurations().size());
	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:28,代码来源:ConfigurationTest.java

示例9: parseConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
		ConfigBean configBean, ParserState parserState) throws ReaderException {
	StringConstantConfig strConfig = unmarshallConfig(t2FlowParser,
			configBean, "xstream", StringConstantConfig.class);
	String value = strConfig.getValue();
	if (value == null)
		throw new ReaderException("String constant configuration has no value set");
	Configuration configuration = new Configuration();
	ObjectNode json = (ObjectNode) configuration.getJson();
	configuration.setType(CONSTANT.resolve("#Config"));
	json.put("string", value);
	
	Activity activity = parserState.getCurrentActivity();
	OutputActivityPort valuePort = new OutputActivityPort(activity, VALUE);
	valuePort.setDepth(0);
	valuePort.setGranularDepth(0);
	return configuration;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:20,代码来源:StringConstantActivityParser.java

示例10: refreshView

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
/**
 * Typically called when the activity configuration has changed.
 */
@Override
public void refreshView() {
	Configuration configuration = scufl2Tools.configurationFor(activity, activity.getParent());
	JsonNode json = configuration.getJson();

	// Set XPath Expression
	tfXPathExpression.setText(json.get("xpathExpression").asText());

	// Populate Namespace Mappings
	xpathNamespaceMappingsTableModel.getDataVector().removeAllElements();
	if (json.has("xpathNamespaceMap")) {
		for (JsonNode mapping : json.get("xpathNamespaceMap")) {
			xpathNamespaceMappingsTableModel.addRow(new Object[] {
					mapping.get("prefix").asText(), mapping.get("uri").asText() });
		}
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:21,代码来源:XPathActivityMainContextualView.java

示例11: doDelete

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
private void doDelete(final Component chosenComponent) {
	if (chosenComponent == null) {
		showMessageDialog(null, WHAT_COMPONENT_MSG,
				COMPONENT_PROBLEM_TITLE, ERROR_MESSAGE);
	} else if (componentIsInUse(chosenComponent)) {
		showMessageDialog(null, OPEN_COMPONENT_MSG,
				COMPONENT_PROBLEM_TITLE, ERROR_MESSAGE);
	} else if (showConfirmDialog(null,
			format(CONFIRM_MSG, chosenComponent.getName()), CONFIRM_TITLE,
			YES_NO_OPTION) == YES_OPTION)
		new SwingWorker<Configuration, Object>() {
			@Override
			protected Configuration doInBackground() throws Exception {
				return deleteComponent(chosenComponent);
			}

			@Override
			protected void done() {
				refresh(chosenComponent, this);
			}
		}.execute();
}
 
开发者ID:apache,项目名称:incubator-taverna-plugin-component,代码行数:23,代码来源:ComponentDeleteAction.java

示例12: parseConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
		ConfigBean configBean, ParserState parserState) throws ReaderException {
	DataflowConfig dataflowConfig = unmarshallConfig(t2FlowParser,
			configBean, "dataflow", DataflowConfig.class);
	Configuration configuration = new Configuration();
	configuration.setType(nestedUri.resolve("#Config"));		

	String wfId = dataflowConfig.getRef();
	URI wfUri = WORKFLOW_ROOT.resolve(wfId + "/");
	Workflow wf = (Workflow) getUriTools().resolveUri(wfUri, parserState.getCurrentWorkflowBundle());		
	if (wf == null)
        throw new ReaderException("Can't find nested workflow with id " + wfId);
	ObjectNode json = configuration.getJsonAsObjectNode();
	json.put("nestedWorkflow", wf.getName());
	return configuration;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:18,代码来源:DataflowActivityParser.java

示例13: parseConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
		ConfigBean configBean, ParserState parserState)
		throws ReaderException {
	ComponentConfig config = unmarshallConfig(t2FlowParser, configBean,
			"xstream", ComponentConfig.class);

	Configuration configuration = new Configuration();
	configuration.setParent(parserState.getCurrentProfile());

	ObjectNode json = (ObjectNode) configuration.getJson();
	configuration.setType(ACTIVITY_URI.resolve("#Config"));

	json.put("registryBase", config.getRegistryBase());
	json.put("familyName", config.getFamilyName());
	json.put("componentName", config.getComponentName());
	if (config.getComponentVersion() != null)
		json.put("componentVersion", (int) config.getComponentVersion());

	return configuration;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:22,代码来源:ComponentActivityParser.java

示例14: checkOneConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
private void checkOneConfiguration(InputWorkflowPort workflowPort,
		Integer depth, Workflow workflow, WorkflowBundle workflowBundle,
		Activity activity, Configuration c) {
	JsonNode nested = c.getJson().get("nestedWorkflow");
	Workflow nestedWorkflow = workflowBundle.getWorkflows().getByName(
			nested.asText());
	if (nestedWorkflow != workflow)
		return;

	ActivityPort activityPort = activity.getInputPorts().getByName(
			workflowPort.getName());
	activityPort.setDepth(depth);
	for (ProcessorBinding binding : scufl2Tools
			.processorBindingsToActivity(activity))
		for (ProcessorInputPortBinding portBinding : binding
				.getInputPortBindings())
			if (portBinding.getBoundActivityPort() == activityPort) {
				InputProcessorPort processorPort = portBinding
						.getBoundProcessorPort();
				processorPort.setDepth(depth);
			}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:23,代码来源:ChangeDepthEdit.java

示例15: changeActivityPortName

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入依赖的package包/类
private void changeActivityPortName(WorkflowPort workflowPort,
		String oldName, String newName, Workflow workflow,
		WorkflowBundle workflowBundle, Activity activity, Configuration c) {
	JsonNode nested = c.getJson().get("nestedWorkflow");
	Workflow nestedWorkflow = workflowBundle.getWorkflows().getByName(
			nested.asText());
	if (nestedWorkflow != workflow)
		return;

	ActivityPort activityPort;
	if (workflowPort instanceof InputPort) {
		activityPort = activity.getInputPorts().getByName(oldName);
		changeProcessorInputPortName(oldName, newName, activity,
				activityPort);
	} else {
		activityPort = activity.getOutputPorts().getByName(oldName);
		changeProcessorOutputPortName(oldName, newName, activity,
				activityPort);
	}
	activityPort.setName(newName);
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:22,代码来源:RenameEdit.java


注:本文中的org.apache.taverna.scufl2.api.configurations.Configuration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。