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


Java NSName.create方法代码示例

本文整理汇总了Java中com.wm.lang.ns.NSName.create方法的典型用法代码示例。如果您正苦于以下问题:Java NSName.create方法的具体用法?Java NSName.create怎么用?Java NSName.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.wm.lang.ns.NSName的用法示例。


在下文中一共展示了NSName.create方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerStubService

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
public void registerStubService(String... svcNames) {
	if (isStubPackageMissing()) {
		createStubPackage();
	}
	for (String svcName : svcNames) {
		if (isRegisteredService(svcName)) {
			continue; // existing service so no stub required
		}
		try {
			NSName name = NSName.create(svcName);
			NSServiceType serviceType = NSServiceType.create("flow", "unknown");
			ServerAPI.registerService(SUPPORTING_PKG, name, true, serviceType , null, null, null);
			stubbedServices.add(svcName);
		} catch (ServiceSetupException e) {
			throw new StubLifecycleException("Error creating stub service for " + svcName, e);
		}
	}
}
 
开发者ID:wmaop,项目名称:wm-aop,代码行数:19,代码来源:StubManager.java

示例2: create

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
/**
 * Creates a new service in the given package with the given name.
 *
 * @param packageName The name of the package to create the service in.
 * @param serviceName The fully-qualified name of the service to be created.
 * @param type        The type of service to be created.
 * @param subtype     The subtype of service to be created.
 * @throws ServiceException If an error creating the service occurs.
 */
private static void create(String packageName, String serviceName, String type, String subtype) throws ServiceException {
    if (!PackageHelper.exists(packageName)) {
        throw new IllegalArgumentException("package does not exist: " + packageName);
    }
    if (NodeHelper.exists(serviceName)) throw new IllegalArgumentException("node already exists: " + serviceName);

    NSName service = NSName.create(serviceName);

    if (type == null) type = NSServiceType.SVC_FLOW;
    if (subtype == null) subtype = NSServiceType.SVCSUB_UNKNOWN;
    NSServiceType serviceType = NSServiceType.create(type, subtype);

    try {
        ServerAPI.registerService(packageName, service, true, serviceType, null, null, null);
    } catch (ServiceSetupException ex) {
        ExceptionHelper.raise(ex);
    }
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:28,代码来源:ServiceHelper.java

示例3: initialize

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
/**
 * Initializes a new routing instruction.
 *
 * @param method      The HTTP method for the instruction.
 * @param uri         The URI for the instruction.
 * @param target      The target for the instruction.
 * @param description The description of the instruction.
 * @param source      The source file of the instruction.
 */
protected void initialize(HTTPMethod method, UriTemplate uri, String target, String description, File source) {
    this.method = method;
    this.uri = uri;
    this.target = target;

    java.util.regex.Matcher matcher = SERVICE_PATTERN.matcher(target);
    isInvoke = matcher.matches();

    if (isInvoke) {
        service = NSName.create(target);
    }

    this.description = description;
    this.source = source;
}
 
开发者ID:Permafrost,项目名称:TundraHTTP.java,代码行数:25,代码来源:HTTPRoute.java

示例4: unregisterStubService

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
public void unregisterStubService(String svcName) throws NSException {
	Package pkg = PackageManager.getPackage(SUPPORTING_PKG);
	if (pkg != null) {
		NSName name = NSName.create(svcName);
		BaseService svc = Namespace.getService(name);
		if (svc != null && SUPPORTING_PKG.equals(svc.getPackageName())) {
			Namespace.current().deleteNode(name, true, pkg);
			stubbedServices.remove(svcName);
		}
	}
}
 
开发者ID:wmaop,项目名称:wm-aop,代码行数:12,代码来源:StubManager.java

示例5: invoke_thread

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
public static final void invoke_thread (IData pipeline)
       throws ServiceException
{
	// --- <<IS-START(invoke_thread)>> ---
	// @sigtype java 3.5
	// [i] field:0:required service
	// [i] field:0:required data
	// [i] record:0:required in
	// [i] object:0:required obj
   IDataHashCursor idc = pipeline.getHashCursor();
   idc.first( "service" );

String svc_name = (String) idc.getValue();
try
{
	NSName nsName = NSName.create(svc_name);
	ServiceThread thrd = Service.doThreadInvoke(nsName, pipeline);
	thrd.getData();
}
catch (Exception e)
{
	throw new ServiceException(e.getMessage());
}
idc.destroy();
	// --- <<IS-END>> ---

               
}
 
开发者ID:iandrosov,项目名称:SimpleToolBox,代码行数:29,代码来源:service.java

示例6: isRegisteredService

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
protected boolean isRegisteredService(String svcName) {
	NSName name = NSName.create(svcName);
	return Namespace.getService(name) != null;
}
 
开发者ID:wmaop,项目名称:wm-aop,代码行数:5,代码来源:StubManager.java

示例7: shouldMatchCorrectNamespacePackage

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
@Test
public void shouldMatchCorrectNamespacePackage() {
	NSName nsnTestService = NSName.create("org.wmaop.pub:testService");
	NSName nsnBarService = NSName.create(PUB_FOO_BAR);
	
	Package pkg1 = mock(Package.class);
	when(pkg1.getName()).thenReturn("pkg1");
	Package pkg2 = mock(Package.class);
	when(pkg2.getName()).thenReturn("pkg2");

	PowerMockito.mockStatic(InvokeState.class);
	InvokeState mockInvokeState = mock(InvokeState.class);
	when(InvokeState.getCurrentState()).thenReturn(mockInvokeState);

	NSService svcTest = mock(NSService.class);
	when(svcTest.getNSName()).thenReturn(nsnTestService);
	when(svcTest.getPackage()).thenReturn(pkg1);
	
	NSService svcBar = mock(NSService.class);
	when(svcBar.getNSName()).thenReturn(nsnBarService);
	when(svcBar.getPackage()).thenReturn(pkg2);
	
	Stack<NSService> callStack = new Stack<>();
	callStack.push(svcTest);
	callStack.push(svcBar);
	when(mockInvokeState.getCallStack()).thenReturn(callStack);
	
	FlowPosition fp = new FlowPosition(InterceptPoint.INVOKE, PUB_FOO_BAR);
	
	assertFalse(new CallingServicePositionMatcher("id", PUB_FOO_BAR, null).match(null).isMatch());
	assertFalse(new CallingServicePositionMatcher("id", PUB_FOO_BAR, null).match( new FlowPosition(InterceptPoint.INVOKE, "nother:service")).isMatch());

	// Check for none or partial namespace and service match
	assertTrue(new CallingServicePositionMatcher("id", PUB_FOO_BAR, null).match(fp).isMatch());
	assertTrue(new CallingServicePositionMatcher("id", PUB_FOO_BAR, "org.wmaop").match(fp).isMatch());
	assertTrue(new CallingServicePositionMatcher("id", PUB_FOO_BAR, "org.wmaop.pub").match(fp).isMatch());
	assertTrue(new CallingServicePositionMatcher("id", PUB_FOO_BAR, "org.wmaop.pub:testService").match(fp).isMatch());
	// Match on the calling package
	assertTrue(new CallingServicePositionMatcher("id", PUB_FOO_BAR, "pkg1").match(fp).isMatch());
	
	// Package for this call which is irrelevant
	assertFalse(new CallingServicePositionMatcher("id", PUB_FOO_BAR, "pkg2").match(fp).isMatch());
	// Matching on some arbitary service
	assertFalse(new CallingServicePositionMatcher("id", PUB_FOO_BAR, "org.wmaop.pub:anotherService").match(fp).isMatch());

	CallingServicePositionMatcher cspm = new CallingServicePositionMatcher("id", PUB_FOO_BAR, "org.wmaop.pub:anotherService");
	cspm.toString();
	assertEquals(PUB_FOO_BAR, cspm.toMap().get("serviceName"));
	assertEquals(PUB_FOO_BAR, cspm.getServiceName());
	
}
 
开发者ID:wmaop,项目名称:wm-aop,代码行数:52,代码来源:CallingServicePositionMatcherTest.java

示例8: createServiceThread

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
public ServiceThread createServiceThread(String service, IData input, Session session, int threadPriority,
		boolean interruptable) {
	return new ReactiveServiceThread(NSName.create(service), session, input, threadPriority, interruptable);
}
 
开发者ID:teivah,项目名称:reactiveWM,代码行数:5,代码来源:ReactiveServiceThreadManager.java

示例9: getName

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
/**
 * Returns the webMethods Integration Server namespace name for the given String.
 *
 * @param name The String to be converted to a namespace name.
 * @return The namespace name representing the given String.
 */
public static NSName getName(String name) {
    if (name == null) return null;
    return NSName.create(name);
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:11,代码来源:NodeHelper.java

示例10: CallableService

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
/**
 * Constructs a new CallableService for invoking a webMethods Integration Server service via the Callable
 * interface.
 *
 * @param service  The fully-qualified service name to be invoked.
 * @param session  The session to invoke the service under.
 * @param pipeline The input pipeline the service is invoked with.
 */
public CallableService(String service, Session session, IData pipeline) {
    this(service == null ? null : NSName.create(service), session, pipeline);
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:12,代码来源:CallableService.java

示例11: RunnableService

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
/**
 * Constructs a new RunnableService for invoking a webMethods Integration Server service via the Runnable
 * interface.
 *
 * @param service  The fully-qualified service name to be invoked.
 * @param session  The session to invoke the service under.
 * @param pipeline The input pipeline the service is invoked with.
 */
public RunnableService(String service, Session session, IData pipeline) {
    this(NSName.create(service), session, pipeline);
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:12,代码来源:RunnableService.java

示例12: CallableGuaranteedJob

import com.wm.lang.ns.NSName; //导入方法依赖的package包/类
/**
 * Creates a new CallableGuaranteedJob which when called invokes the given service against the given job.
 *
 * @param queue             The delivery queue on which the job queued.
 * @param job               The job to be processed.
 * @param service           The service to be invoked to process the given job.
 * @param session           The session used when invoking the given service.
 * @param pipeline          The input pipeline used when invoking the given service.
 * @param retryLimit        The number of retries this job should attempt.
 * @param retryFactor       The factor used to extend the time to wait on each retry.
 * @param timeToWait        The time to wait between each retry.
 * @param suspend           Whether to suspend the delivery queue on job retry exhaustion.
 * @param exhaustedStatus   The status set on the related bizdoc when all retries of the job are exhausted.
 */
public CallableGuaranteedJob(DeliveryQueue queue, GuaranteedJob job, String service, Session session, IData pipeline, int retryLimit, float retryFactor, Duration timeToWait, boolean suspend, String exhaustedStatus) {
    this(queue, job, service == null ? null : NSName.create(service), session, pipeline, retryLimit, retryFactor, timeToWait, suspend, exhaustedStatus);
}
 
开发者ID:Permafrost,项目名称:TundraTN.java,代码行数:18,代码来源:CallableGuaranteedJob.java


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