1 | /* |
2 | |
3 | Derby - Class org.apache.derby.client.net.OpenSocketAction |
4 | |
5 | Copyright (c) 2002, 2005 The Apache Software Foundation or its licensors, where applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.client.net; |
22 | |
23 | public class OpenSocketAction implements java.security.PrivilegedExceptionAction { |
24 | private String server_; |
25 | private int port_; |
26 | |
27 | public OpenSocketAction(String server, int port) { |
28 | server_ = server; |
29 | port_ = port; |
30 | } |
31 | |
32 | public Object run() throws java.net.UnknownHostException, java.io.IOException { |
33 | return new java.net.Socket(server_, port_); |
34 | } |
35 | } |