/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static Connection open(String name) throws IOException { return open(name, READ_WRITE); }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static InputStream openInputStream(String name) throws IOException { return openDataInputStream(name); }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static OutputStream openOutputStream(String name) throws IOException { return openDataOutputStream(name); }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static Connection open(String name, int mode) throws IOException { return open(name, mode, false); }
/** * Open the <code>MessageConnection</code> to use for sending messages. * * @throws IOException * if we fail to open the connection. */ protected synchronized void openConnection(String connectionString) throws IOException { if (messageConnection == null) { messageConnection = (MessageConnection) Connector .open(connectionString); } }
/** * Opens the StreamConnectionNotifier. * * @return Server connection opened for clients. * @throws IOException */ private StreamConnectionNotifier createNotifier() throws IOException { return (StreamConnectionNotifier) Connector.open("btspp://localhost:" + DEFAULT_BT_UUID_STRING); }
/** * @see net.sf.microlog.core.appender.AbstractAppender#open() */ public void open() throws IOException { StringBuffer connectionStringBuffer = new StringBuffer(32); connectionStringBuffer.append("datagram://"); connectionStringBuffer.append(host); connectionStringBuffer.append(':'); connectionStringBuffer.append(port); connection = (DatagramConnection) Connector.open(connectionStringBuffer .toString()); logOpen = true; }
public StreamConnection openConnection() throws IOException { checkIsOpened(); StreamConnection connection = (StreamConnection) Connector.open(connectionUrl, 2); connections.add(connection); return connection; }
/** * Open the log, i.e. it opens the <code>CommConnection</code>. * * @see net.sf.microlog.core.appender.AbstractAppender#open() */ public void open() throws IOException { // If no serial port is defined, use the first available port if (comPort == null) { String ports = System.getProperty("microedition.commports"); int comma = ports.indexOf(','); if (comma > 0) { // Parse the first port from the available ports list. comPort = ports.substring(0, comma); } else { // Only one serial port available. comPort = ports; } } String connectionString = SerialAppender.COMM_SCHEME + comPort; connection = (CommConnection) Connector.open(connectionString); dataOutputStream = connection.openDataOutputStream(); logOpen = true; }
protected OutputStream connect() throws IOException { connection = (HttpConnection) Connector.open(postURL); connection.setRequestMethod(HttpConnection.POST); return connection.openOutputStream(); }
/** * @see net.sf.microlog.core.appender.AbstractAppender#open() */ public synchronized void open() throws IOException { if (socketConnection == null && serverName != null) { String connectionString = protocol + serverName + ':' + port; socketConnection = (SocketConnection) Connector .open(connectionString); socketConnection.setSocketOption(SocketConnection.LINGER, linger); dataOutputStream = socketConnection.openDataOutputStream(); logOpen = true; } }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static DataInputStream openDataInputStream(String name) throws IOException { Connection c= Connector.open(name, Connector.READ); try { if(!(c instanceof InputConnection)) { throw new IllegalArgumentException(name + " does not refer to an InputConnection"); } return ((InputConnection) c).openDataInputStream(); } finally { c.close(); } }
/** * @throws IllegalArgumentException * @throws ConnectionNotFoundException * @throws IOException * @throws SecurityException */ public static DataOutputStream openDataOutputStream(String name) throws IOException { Connection c= Connector.open(name, Connector.WRITE); try { if(!(c instanceof OutputConnection)) { throw new IllegalArgumentException(name + " does not refer to an OutputConnection"); } return ((OutputConnection) c).openDataOutputStream(); } finally { c.close(); } }
connection = Connector.open(name, mode, timeouts); } catch (Exception ex)
byte[] xmlBytes = soapRequest.getBytes(); conn = ( HttpConnection ) Connector.open( urlAddress ); conn.setRequestProperty( "Content-Length", String.valueOf( xmlBytes.length ) ); conn.setRequestProperty( "Content-Type", "text/xml; charset=utf-8" );
mStreamConnection = (StreamConnection) Connector.open(mConnectionURL); mOutStream = mStreamConnection.openOutputStream(); mInStream = mStreamConnection.openInputStream();