⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ws2impl.java

📁 Xfire文件 用于开发web service 的一个开源工具 很好用的
💻 JAVA
字号:
package org.codehaus.xfire.aegis.inheritance.ws2.impl;

import java.util.HashMap;
import java.util.Map;

import org.codehaus.xfire.aegis.inheritance.ws2.WS2;
import org.codehaus.xfire.aegis.inheritance.ws2.common.ParentBean;
import org.codehaus.xfire.aegis.inheritance.ws2.common.exception.AlreadyExistsException;
import org.codehaus.xfire.aegis.inheritance.ws2.common.exception.NotFoundException;
import org.codehaus.xfire.aegis.inheritance.ws2.common.pack1.ContentBean1;
import org.codehaus.xfire.aegis.inheritance.ws2.common.pack2.ContentBean2;

/**
 * <br/>
 * 
 * @author xfournet
 */
public class WS2Impl
    implements WS2
{
    private Map m_map = new HashMap();

    public WS2Impl()
    {
        ParentBean x = new ParentBean("X", new ContentBean1("data1-X"));
        ParentBean y = new ParentBean("Y", new ContentBean2("data1-Y", "content2-Y"));
        m_map.put(x.getId(), x);
        m_map.put(y.getId(), y);
    }

    public synchronized void putParentBean(ParentBean parentBean)
        throws AlreadyExistsException
    {
        String id = parentBean.getId();
        if (m_map.containsKey(id))
        {
            throw new AlreadyExistsException(id);
        }
        m_map.put(id, parentBean);
    }

    public synchronized ParentBean getParentBean(String id)
        throws NotFoundException
    {
        ParentBean result = (ParentBean) m_map.get(id);
        if (result == null)
        {
            throw new NotFoundException(id);
        }

        return result;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -