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


Java RuntimeIoException类代码示例

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


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

示例1: getMessage

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
public Object getMessage() {
    if (isDone()) {
        Object v = getValue();
        if (v == CLOSED) {
            return null;
        }

        if (v instanceof ExceptionHolder) {
            v = ((ExceptionHolder) v).exception;
            if (v instanceof RuntimeException) {
                throw (RuntimeException) v;
            }
            if (v instanceof Error) {
                throw (Error) v;
            }
            if (v instanceof IOException || v instanceof Exception) {
                throw new RuntimeIoException((Exception) v);
            }
        }

        return v;
    }

    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:26,代码来源:DefaultReadFuture.java

示例2: connect

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 * Attempt to connect to the info server.
 */
public void connect()
{
	try
	{
		ConnectFuture future = connector.connect(new InetSocketAddress(IP, PORT));
		future.awaitUninterruptibly(AWAIT_TIME);

		IoSession session = future.getSession();
		session.getFilterChain().addFirst("protocol", new ProtocolCodecFilter(factory));
		state = State.READY;
		this.onConnect(session);
	}
	catch(RuntimeIoException e)
	{
		this.onFailure(e);
	}
}
 
开发者ID:grahamedgecombe,项目名称:opencraft,代码行数:21,代码来源:OCClient.java

示例3: main

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
public static void main(String[] args) {
	NioSocketConnector connector = new NioSocketConnector(); //TCP Connector
	connector.getFilterChain().addLast("logging", new LoggingFilter());
	connector.getFilterChain().addLast("codec",new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
    connector.getFilterChain().addLast("mdc", new MdcInjectionFilter());
	connector.setHandler(new HelloClientHandler());
    IoSession session;

    for (;;) {
        try {
            ConnectFuture future = connector.connect(new InetSocketAddress(HOSTNAME, PORT));
            future.awaitUninterruptibly();
            session = future.getSession();
            break;
        } catch (RuntimeIoException e) {
            System.err.println("Failed to connect.");
            e.printStackTrace();
        }
    }
    session.getCloseFuture().awaitUninterruptibly();
    connector.dispose();
}
 
开发者ID:ameizi,项目名称:mina-examples,代码行数:23,代码来源:HelloTcpClient.java

示例4: NioProcessor

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 *
 * Creates a new instance of NioProcessor.
 *
 * @param executor
 */
public NioProcessor(Executor executor) {
    super(executor);

    try {
        // Open a new selector
        selector = Selector.open();
    } catch (IOException e) {
        throw new RuntimeIoException("Failed to open a selector.", e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:NioProcessor.java

示例5: isBroadcast

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 * Tells if SO_BROADCAST is enabled.
 * 
 * @return <code>true</code> if SO_BROADCAST is enabled
 * @throws RuntimeIoException If the socket is closed or if we get an
 * {@link SocketException} 
 */
public boolean isBroadcast() {
    try {
        return channel.socket().getBroadcast();
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:NioDatagramSessionConfig.java

示例6: setBroadcast

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
public void setBroadcast(boolean broadcast) {
    try {
        channel.socket().setBroadcast(broadcast);
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:NioDatagramSessionConfig.java

示例7: getSendBufferSize

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 * 
 * @throws RuntimeIoException If the socket is closed or if we get an
 * {@link SocketException} 
 */
public int getSendBufferSize() {
    try {
        return channel.socket().getSendBufferSize();
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:NioDatagramSessionConfig.java

示例8: setSendBufferSize

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 * 
 * @throws RuntimeIoException If the socket is closed or if we get an
 * {@link SocketException} 
 */
public void setSendBufferSize(int sendBufferSize) {
    try {
        channel.socket().setSendBufferSize(sendBufferSize);
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:NioDatagramSessionConfig.java

示例9: isReuseAddress

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 * Tells if SO_REUSEADDR is enabled.
 * 
 * @return <code>true</code> if SO_REUSEADDR is enabled
 * @throws RuntimeIoException If the socket is closed or if we get an
 * {@link SocketException} 
 */
public boolean isReuseAddress() {
    try {
        return channel.socket().getReuseAddress();
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:NioDatagramSessionConfig.java

示例10: setReuseAddress

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 * 
 * @throws RuntimeIoException If the socket is closed or if we get an
 * {@link SocketException} 
 */
public void setReuseAddress(boolean reuseAddress) {
    try {
        channel.socket().setReuseAddress(reuseAddress);
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:NioDatagramSessionConfig.java

示例11: setTrafficClass

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 * @throws RuntimeIoException If the socket is closed or if we get an
 * {@link SocketException} 
 */
public void setTrafficClass(int trafficClass) {
    try {
        channel.socket().setTrafficClass(trafficClass);
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:NioDatagramSessionConfig.java

示例12: isKeepAlive

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
public boolean isKeepAlive() {
    try {
        return getSocket().getKeepAlive();
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:NioSocketSession.java

示例13: setKeepAlive

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
public void setKeepAlive(boolean on) {
    try {
        getSocket().setKeepAlive(on);
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:NioSocketSession.java

示例14: isOobInline

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
public boolean isOobInline() {
    try {
        return getSocket().getOOBInline();
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:NioSocketSession.java

示例15: setOobInline

import org.apache.mina.core.RuntimeIoException; //导入依赖的package包/类
public void setOobInline(boolean on) {
    try {
        getSocket().setOOBInline(on);
    } catch (SocketException e) {
        throw new RuntimeIoException(e);
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:NioSocketSession.java


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