bump product version to 5.0.4.1
[LibreOffice.git] / jurt / com / sun / star / lib / connections / pipe / pipeAcceptor.java
blob58400b3b35c9c80ecf2c2017383ee565a2dcde25
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package com.sun.star.lib.connections.pipe;
21 import com.sun.star.comp.loader.FactoryHelper;
22 import com.sun.star.connection.AlreadyAcceptingException;
23 import com.sun.star.connection.ConnectionSetupException;
24 import com.sun.star.connection.XAcceptor;
25 import com.sun.star.connection.XConnection;
26 import com.sun.star.lang.XMultiServiceFactory;
27 import com.sun.star.lang.XSingleServiceFactory;
28 import com.sun.star.registry.XRegistryKey;
30 /**
31 * A component that implements the <code>XAcceptor</code> interface.
33 * <p>The <code>pipeAcceptor</code> is a specialized component that uses TCP
34 * pipes for communication. The <code>pipeAcceptor</code> is generally used
35 * by the <code>com.sun.star.connection.Acceptor</code> service.</p>
37 * @see com.sun.star.connection.XAcceptor
38 * @see com.sun.star.connection.XConnection
39 * @see com.sun.star.connection.XConnector
40 * @see com.sun.star.comp.loader.JavaLoader
42 * @since UDK 1.0
44 public final class pipeAcceptor implements XAcceptor {
45 /**
46 * The name of the service.
48 * <p>The <code>JavaLoader</code> accesses this through reflection.</p>
50 * @see com.sun.star.comp.loader.JavaLoader
52 public static final String __serviceName
53 = "com.sun.star.connection.pipeAcceptor";
55 /**
56 * Returns a factory for creating the service.
58 * <p>This method is called by the <code>JavaLoader</code>.</p>
60 * @param implName the name of the implementation for which a service is
61 * requested.
62 * @param multiFactory the service manager to be used (if needed).
63 * @param regKey the registry key.
64 * @return an <code>XSingleServiceFactory</code> for creating the component.
66 * @see com.sun.star.comp.loader.JavaLoader
68 public static XSingleServiceFactory __getServiceFactory(
69 String implName, XMultiServiceFactory multiFactory, XRegistryKey regKey)
71 return implName.equals(pipeAcceptor.class.getName())
72 ? FactoryHelper.getServiceFactory(
73 pipeAcceptor.class, __serviceName, multiFactory, regKey)
74 : null;
77 /**
78 * Accepts a connection request via the described pipe.
80 * <p>This call blocks until a connection has been established.</p>
82 * <p>The connection description has the following format:
83 * <code><var>type</var></code><!--
84 * -->*(<code><var>key</var>=<var>value</var></code>),
85 * where <code><var>type</var></code> should be <code>pipe</code>
86 * (ignoring case). Supported keys (ignoring case) currently are</p>
87 * <dl>
88 * <dt><code>host</code>
89 * <dd>The name or address of the accepting interface (defaults to
90 * <code>0</code>, meaning any interface).
91 * <dt><code>port</code>
92 * <dd>The TCP port number to accept on (defaults to <code>6001</code>).
93 * <dt><code>backlog</code>
94 * <dd>The maximum length of the acceptor's queue (defaults to
95 * <code>50</code>).
96 * <dt><code>tcpnodelay</code>
97 * <dd>A flag (<code>0</code>/<code>1</code>) enabling or disabling Nagle's
98 * algorithm on the resulting connection.
99 * </dl>
101 * @param connectionDescription the description of the connection.
102 * @return an <code>XConnection</code> to the client.
104 * @see com.sun.star.connection.XConnection
105 * @see com.sun.star.connection.XConnector
107 public XConnection accept(String connectionDescription) throws
108 AlreadyAcceptingException, ConnectionSetupException,
109 com.sun.star.lang.IllegalArgumentException
111 throw new java.lang.NoSuchMethodError( "pipeAcceptor not fully implemented yet" );
116 * @see com.sun.star.connection.XAcceptor#stopAccepting
118 public void stopAccepting() {