X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fmethod%2FClient.java;h=223bf5112ab1c35a1001b433e6742bda46c85a10;hb=3f5adda763f6281e9988277d067c1f71615e3da2;hp=239333701357c89bd71fcc17cdc9d16331f8e372;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/method/Client.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/method/Client.java index 239333701..223bf5112 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/method/Client.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/method/Client.java @@ -1,25 +1,25 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ +/******************************************************************************* + * Copyright (c) 2010 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.databoard.method; -import java.io.IOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Socket; - -import org.simantics.databoard.Methods; -import org.simantics.databoard.binding.error.BindingException; -import org.simantics.databoard.method.TcpConnection.ConnectionListener; -import org.simantics.databoard.serialization.SerializationException; +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; + +import org.simantics.databoard.Methods; +import org.simantics.databoard.binding.error.BindingException; +import org.simantics.databoard.method.TcpConnection.ConnectionListener; +import org.simantics.databoard.serialization.SerializationException; /** * Proxy InterfaceBinding over a socket. @@ -32,7 +32,7 @@ public class Client implements MethodInterface { TcpConnection c; /** - * Create a new method interface client. On successful construction the + * Create a new method interface client. On successful construction the * connection is established over TCP/IP channel. * * @param addr @@ -45,28 +45,28 @@ public class Client implements MethodInterface { throws IOException, SerializationException, BindingException { this(InetAddress.getByName(addr), port); } - - /** - * Create a new method interface client. On successful construction the - * connection is established over TCP/IP channel. - * - * @param sa - * @throws IOException connection error - * @throws SerializationException handshake communication error - * @throws BindingException handshake communication error - */ - public Client(InetSocketAddress sa) - throws IOException, SerializationException, BindingException { - s = new Socket(sa.getAddress(), sa.getPort()); - Handshake local = new Handshake(); - local.methods = Methods.noMethods().getInterface().getMethodDefinitions(); - Handshake remote = TcpConnection.handshake(s, local); - c = new TcpConnection(s, Methods.noMethods(), local, remote); - } /** - * Create a new method interface client. On successful construction the - * connection is established over TCP/IP channel. + * Create a new method interface client. On successful construction the + * connection is established over TCP/IP channel. + * + * @param sa + * @throws IOException connection error + * @throws SerializationException handshake communication error + * @throws BindingException handshake communication error + */ + public Client(InetSocketAddress sa) + throws IOException, SerializationException, BindingException { + s = new Socket(sa.getAddress(), sa.getPort()); + Handshake local = new Handshake(); + local.methods = Methods.noMethods().getInterface().getMethodDefinitions(); + Handshake remote = TcpConnection.handshake(s, local); + c = new TcpConnection(s, Methods.noMethods(), local, remote); + } + + /** + * Create a new method interface client. On successful construction the + * connection is established over TCP/IP channel. * * @param addr * @param port @@ -84,8 +84,8 @@ public class Client implements MethodInterface { } /** - * Create a new method interface client. On successful construction the - * connection is established over TCP/IP channel. + * Create a new method interface client. On successful construction the + * connection is established over TCP/IP channel. * * @param addr * @param port @@ -126,7 +126,7 @@ public class Client implements MethodInterface { public Method getMethod(MethodTypeDefinition description) throws MethodNotSupportedException { return c.getMethod(description); - } + } public TcpConnection getConnection() {