Source Code Cross Referenced for NativeProcessProvider.java in  » Net » j2ssh » com » sshtools » daemon » platform » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » j2ssh » com.sshtools.daemon.platform 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  SSHTools - Java SSH2 API
003:         *
004:         *  Copyright (C) 2002-2003 Lee David Painter and Contributors.
005:         *
006:         *  Contributions made by:
007:         *
008:         *  Brett Smith
009:         *  Richard Pernavas
010:         *  Erwin Bolwidt
011:         *
012:         *  This program is free software; you can redistribute it and/or
013:         *  modify it under the terms of the GNU General Public License
014:         *  as published by the Free Software Foundation; either version 2
015:         *  of the License, or (at your option) any later version.
016:         *
017:         *  This program is distributed in the hope that it will be useful,
018:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
019:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
020:         *  GNU General Public License for more details.
021:         *
022:         *  You should have received a copy of the GNU General Public License
023:         *  along with this program; if not, write to the Free Software
024:         *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
025:         */
026:        package com.sshtools.daemon.platform;
027:
028:        import com.sshtools.daemon.configuration.PlatformConfiguration;
029:
030:        import com.sshtools.j2ssh.configuration.ConfigurationLoader;
031:
032:        import org.apache.commons.logging.Log;
033:        import org.apache.commons.logging.LogFactory;
034:
035:        import java.io.IOException;
036:        import java.io.InputStream;
037:        import java.io.OutputStream;
038:
039:        import java.util.Map;
040:
041:        /**
042:         *
043:         *
044:         * @author $author$
045:         * @version $Revision: 1.14 $
046:         */
047:        public abstract class NativeProcessProvider { //implements SessionDataProvider {
048:
049:            private static Log log = LogFactory
050:                    .getLog(NativeProcessProvider.class);
051:            private static Class provider;
052:
053:            static {
054:                try {
055:                    if (ConfigurationLoader
056:                            .isConfigurationAvailable(PlatformConfiguration.class)) {
057:                        provider = ConfigurationLoader
058:                                .getExtensionClass(((PlatformConfiguration) ConfigurationLoader
059:                                        .getConfiguration(PlatformConfiguration.class))
060:                                        .getNativeProcessProvider());
061:                    }
062:                } catch (Exception e) {
063:                    log.error("Failed to load native process provider", e);
064:                    provider = null;
065:                }
066:            }
067:
068:            /**
069:             *
070:             *
071:             * @return
072:             *
073:             * @throws IOException
074:             */
075:            public static NativeProcessProvider newInstance()
076:                    throws IOException {
077:                try {
078:                    return (NativeProcessProvider) provider.newInstance();
079:                } catch (Exception e) {
080:                    throw new IOException(
081:                            "The process provider failed to create a new instance: "
082:                                    + e.getMessage());
083:                }
084:            }
085:
086:            /**
087:             *
088:             *
089:             * @param provider
090:             */
091:            public static void setProvider(Class provider) {
092:                NativeProcessProvider.provider = provider;
093:            }
094:
095:            /**
096:             *
097:             *
098:             * @return
099:             *
100:             * @throws IOException
101:             */
102:            public abstract InputStream getInputStream() throws IOException;
103:
104:            /**
105:             *
106:             *
107:             * @return
108:             *
109:             * @throws IOException
110:             */
111:            public abstract OutputStream getOutputStream() throws IOException;
112:
113:            /**
114:             *
115:             *
116:             * @return
117:             */
118:            public abstract InputStream getStderrInputStream()
119:                    throws IOException;
120:
121:            /**
122:             *
123:             */
124:            public abstract void kill();
125:
126:            /**
127:             *
128:             *
129:             * @return
130:             */
131:            public abstract boolean stillActive();
132:
133:            /**
134:             *
135:             *
136:             * @return
137:             */
138:            public abstract int waitForExitCode();
139:
140:            /**
141:             *
142:             *
143:             * @return
144:             */
145:            public abstract String getDefaultTerminalProvider();
146:
147:            /**
148:             *
149:             *
150:             * @param command
151:             * @param environment
152:             *
153:             * @return
154:             *
155:             * @throws IOException
156:             */
157:            public abstract boolean createProcess(String command,
158:                    Map environment) throws IOException;
159:
160:            /**
161:             *
162:             *
163:             * @throws IOException
164:             */
165:            public abstract void start() throws IOException;
166:
167:            /**
168:             *
169:             *
170:             * @param term
171:             *
172:             * @return
173:             */
174:            public abstract boolean supportsPseudoTerminal(String term);
175:
176:            /**
177:             *
178:             *
179:             * @param term
180:             * @param cols
181:             * @param rows
182:             * @param width
183:             * @param height
184:             * @param modes
185:             *
186:             * @return
187:             */
188:            public abstract boolean allocatePseudoTerminal(String term,
189:                    int cols, int rows, int width, int height, String modes);
190:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.