📄 sessionhandler.java
字号:
/* * Copyright (c) 2005-2006, logicAlloy, Inc. All Rights Reserved. * * Licensed under the Sleepycat License (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.opensource.org/licenses/sleepycat.php * * 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 com.logicalloy.ale.client;import org.codehaus.xfire.handler.AbstractHandler;import org.codehaus.xfire.MessageContext;import org.jdom.Element;import org.jdom.Namespace;import org.apache.log4j.Logger;/** * Created by IntelliJ IDEA. * User: Administrator * Date: Jul 27, 2006 * Time: 12:21:36 AM * To change this template use File | Settings | File Templates. */public class SessionHandler extends AbstractHandler { private static final Logger logger = Logger.getLogger(SessionHandler.class); private String sessionId = null; public SessionHandler() { } public SessionHandler(String sessionId) { this.sessionId = sessionId; } public void setSessionId(String sessionId) { this.sessionId = sessionId; } public void invoke(MessageContext context) throws Exception { logger.trace("invoke :: enter"); logger.debug(sessionId); try { Element el = context.getOutMessage().getOrCreateHeader(); final Namespace ns = Namespace.getNamespace("alens", "http://logicalloy.com/ale"); el.addNamespaceDeclaration(ns); Element session = new Element("SessionHeader", ns); Element sessId = new Element("sessionId", ns); sessId.addContent(sessionId); session.addContent(sessId); el.addContent(session); } catch (Exception e) { logger.error("Error invoking SessionHandler.", e); throw e; } logger.trace("invoke :: exit"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -