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


Java HandlerChain.iterator方法代码示例

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


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

示例1: initHandlerChain

import javax.xml.rpc.handler.HandlerChain; //导入方法依赖的package包/类
private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
        HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) {
    HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
    @SuppressWarnings("unchecked") // Can't change the API
    Iterator<Handler> iter = handlerChain.iterator();
    while (iter.hasNext()) {
        Handler handler = iter.next();
        handler.init(handlerInfo);
    }
    String[] soaprolesRegistered = handlerChain.getRoles();
    String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
    int i;
    for (i = 0;i < soaprolesRegistered.length; i++)
        soaproles[i] = soaprolesRegistered[i];
    for (int j = 0; j < soaprolesToAdd.size(); j++)
        soaproles[i+j] = soaprolesToAdd.get(j);
    handlerChain.setRoles(soaproles);
    handlerRegistry.setHandlerChain(portName, handlerChain);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:20,代码来源:ServiceRefFactory.java

示例2: getJPlagStub

import javax.xml.rpc.handler.HandlerChain; //导入方法依赖的package包/类
protected JPlagTyp_Stub getJPlagStub() {
     if (stub == null) {
         stub = (JPlagTyp_Stub) (new JPlagService_Impl()
                 .getJPlagServicePort());

         HandlerChain handlerchain = stub._getHandlerChain();
@SuppressWarnings("unchecked")
Iterator<Handler> handlers = handlerchain.iterator();
         while (handlers.hasNext()) {
	Handler handler = handlers.next();
             if (handler instanceof JPlagClientAccessHandler) {
                 accessHandler = ((JPlagClientAccessHandler) handler);
                 break;
             }
         }
     }
     if (accessHandler != null) {
         accessHandler.setUserPassObjects(atujplag.getUsername(),
                 atujplag.getPassword());
     }
     return stub;
 }
 
开发者ID:jplag,项目名称:jplag,代码行数:23,代码来源:SimpleClient.java

示例3: generateStub

import javax.xml.rpc.handler.HandlerChain; //导入方法依赖的package包/类
private JPlagTyp_Stub generateStub() {
	if (this.stub == null) {
		stub = (JPlagTyp_Stub) (new JPlagService_Impl()
				.getJPlagServicePort());

		HandlerChain handlerchain = stub._getHandlerChain();
		@SuppressWarnings("unchecked")
		Iterator<Handler> handlers = handlerchain.iterator();
		while (handlers.hasNext()) {
			Handler handler = handlers.next();
			if (handler instanceof JPlagClientAccessHandler) {
				this.accessHandler = ((JPlagClientAccessHandler) handler);
				break;
			}
		}
	}
	if (accessHandler != null) {
		accessHandler.setUserPassObjects(atujplag.getUsername(),
				atujplag.getPassword());
	}
	return this.stub;
}
 
开发者ID:jplag,项目名称:jplag,代码行数:23,代码来源:SubmittedClient.java

示例4: getJPlagStub

import javax.xml.rpc.handler.HandlerChain; //导入方法依赖的package包/类
/**
 * Returns a singleton JPlag stub
 * 
 * @return The JPlag stub object
 */
public JPlagTyp_Stub getJPlagStub() {
	if (stub == null) {
		stub = (JPlagTyp_Stub) (new JPlagService_Impl().getJPlagServicePort());

		HandlerChain handlerchain = stub._getHandlerChain();
		@SuppressWarnings("unchecked")
		Iterator<Handler> handlers = handlerchain.iterator();
		while (handlers.hasNext()) {
			Handler handler = handlers.next();
			if (handler instanceof JPlagClientAccessHandler) {
				accessHandler = ((JPlagClientAccessHandler) handler);
				break;
			}
		}
	}
	return stub;
}
 
开发者ID:jplag,项目名称:jplag,代码行数:23,代码来源:AdminTool.java

示例5: JPlagBean

import javax.xml.rpc.handler.HandlerChain; //导入方法依赖的package包/类
public JPlagBean() {
	// Setup SSL stuff to allow message encryption
	//		System.setProperty("javax.net.ssl.trustStorePassword", "gulpie!");
	//		System.setProperty("javax.net.ssl.trustStore", System.getProperty("catalina.home") + File.separator + "server.trust");
	//		System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
	//		java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

	stub = (JPlagTyp_Stub) (new JPlagService_Impl().getJPlagServicePort());

	// Set the server page login data

	HandlerChain handlerchain = stub._getHandlerChain();
	@SuppressWarnings("unchecked")
	Iterator<Handler> handlers = handlerchain.iterator();
	while (handlers.hasNext()) {
		Handler handler = handlers.next();
		if (handler instanceof JPlagClientAccessHandler) {
			((JPlagClientAccessHandler) handler).setUserPassObjects("JPlagJSP", "#Ca+#h8n4un!");
			return;
		}
	}
	throw new RuntimeException("JPlagBean(): Unable to find client access" + " handler!");
}
 
开发者ID:jplag,项目名称:jplag,代码行数:24,代码来源:JPlagBean.java

示例6: getJplagStub

import javax.xml.rpc.handler.HandlerChain; //导入方法依赖的package包/类
public JPlagTyp_Stub getJplagStub() {
	if (stub == null) {
		stub = (JPlagTyp_Stub) (new JPlagService_Impl().getJPlagServicePort());

		HandlerChain handlerchain = stub._getHandlerChain();
		@SuppressWarnings("unchecked")
		Iterator<Handler> handlers = handlerchain.iterator();
		while (handlers.hasNext()) {
			Handler handler = handlers.next();
			if (handler instanceof JPlagClientAccessHandler) {
				accessHandler = ((JPlagClientAccessHandler) handler);
				break;
			}
		}
	}
	if (accessHandler != null) {
		accessHandler.setUserPassObjects(getJUsernameField().getText(), String.valueOf(getJPasswordField().getPassword()));
	}
	return stub;
}
 
开发者ID:jplag,项目名称:jplag,代码行数:21,代码来源:JplagSwingClient.java

示例7: main

import javax.xml.rpc.handler.HandlerChain; //导入方法依赖的package包/类
public static void main(String[] args) {

		if (args.length != 2) {
			System.out.println("jplan CLI needs two parameters: username and password!");
			System.exit(1);
		}

		try {
			JplagClient jpClient = new JplagClient();
			jpClient.stub = (JPlagTyp_Stub) (new JPlagService_Impl().getJPlagServicePort());

			HandlerChain handlerchain = jpClient.stub._getHandlerChain();
			@SuppressWarnings("rawtypes")
			Iterator handlers = handlerchain.iterator();
			while (handlers.hasNext()) {
				Handler handler = (Handler) handlers.next();
				if (handler instanceof JPlagClientAccessHandler) {
					jpClient.accessHandler = ((JPlagClientAccessHandler) handler);
					break;
				}
			}
			if (jpClient.accessHandler == null) {
				System.out.println("Unable to find access handler!");
			} else {
				jpClient.accessHandler.setUserPassObjects(args[0], args[1]);
			}

			ServerInfo serverInfo = jpClient.invoke_getServerInfo();
			String lstr = "";
			LanguageInfo[] langs = serverInfo.getLanguageInfos();
			for (int i = 0; i < langs.length; i++) {
				lstr += "\nLanguage: " + langs[i].getName() + "\nSuffixes: ";
				String[] suf = langs[i].getSuffixes();
				for (int j = 0; j < suf.length; j++)
					lstr += suf[j] + ((j < suf.length - 1) ? "," : "");
				lstr += "\nDefault minimum token length: " + langs[i].getDefMinMatchLen() + "\n";
			}

			String str = "";
			Submission[] subs = serverInfo.getSubmissions();
			for (int i = 0; i < subs.length; i++) {
				str += "Submission ID: " + subs[i].getSubmissionID() + " Title: " + subs[i].getTitle() + " Date: " + subs[i].getDate()
						+ "\n";
			}

			System.out.println("Left submission slots: " + serverInfo.getUserInfo().getLeftSubmissionSlots());
			System.out.println("Account end date: " + serverInfo.getUserInfo().getExpires());
			System.out.println("List of languages:\n" + lstr + "\nList of submissions on server:\n" + str);

			if (args.length == 2) {
				String containerid = jpClient.invoke_compareSource(args);
				Status status;
				System.out.println("Waiting for server to be done...");
				do {
					Thread.sleep(4000);
					status = jpClient.stub.getStatus(containerid);
					System.out.println("State=" + status.getState() + " Progress=" + status.getProgress());
					//					System.out.flush();
				} while (status.getState() >= WAITING_IN_QUEUE && status.getState() < COMPARE_SOURCE_DONE);
				if (status.getState() == BAD_USER_ID) {
					System.out.println("ARGH! Where did my container go?!?      " + status.getReport());
				} else if (status.getState() == UNKOWN_ERROR_OCCURED || status.getState() == BAD_LANGUAGE_ERROR
						|| status.getState() == NO_ENOUGH_SUBMISSIONS_ERROR) {
					System.out.println("Error occurred: " + status.getReport());
				} else {
					jpClient.extractPart(jpClient.stub.getResult(containerid), args[1]);
				}
			}

		} catch (Exception ex) {
			if (ex instanceof JPlagException) {
				JPlagException jex = (JPlagException) ex;
				System.out.println(jex.getExceptionType());
				System.out.println(jex.getDescription());
				System.out.println(jex.getRepair());
			}
			ex.printStackTrace();
		}
	}
 
开发者ID:jplag,项目名称:jplag,代码行数:80,代码来源:JplagClient.java


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