Source Code Cross Referenced for VMStandin.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » launching » 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 » IDE Eclipse » jdt » org.eclipse.jdt.launching 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdt.launching;
011:
012:        /**
013:         * An implementation of IVMInstall that is used for manipulating VMs without necessarily 
014:         * committing changes.
015:         * <p>
016:         * Instances of this class act like wrappers.  All other instances of IVMInstall represent 
017:         * 'real live' VMs that may be used for building or launching.  Instances of this class
018:         * behave like 'temporary' VMs that are not visible and not available for building or launching.
019:         * </p>
020:         * <p>
021:         * Instances of this class may be constructed as a preliminary step to creating a 'live' VM
022:         * or as a preliminary step to making changes to a 'real' VM.
023:         * </p>
024:         * When <code>convertToRealVM</code> is called, a corresponding 'real' VM is created
025:         * if one did not previously exist, or the corresponding 'real' VM is updated.
026:         * </p>
027:         * <p>
028:         * Clients may instantiate this class; it is not intended to be subclassed.
029:         * </p>
030:         * 
031:         * @since 2.1
032:         */
033:        public class VMStandin extends AbstractVMInstall {
034:
035:            /**
036:             * <code>java.version</code> system property, or <code>null</code>
037:             * @since 3.1
038:             */
039:            private String fJavaVersion = null;
040:
041:            /*
042:             * @see org.eclipse.jdt.launching.AbstractVMInstall#AbstractVMInstall(org.eclipse.jdt.launching.IVMInstallType, java.lang.String)
043:             */
044:            public VMStandin(IVMInstallType type, String id) {
045:                super (type, id);
046:                setNotify(false);
047:            }
048:
049:            /**
050:             * Constructs a copy of the specified VM with the given identifier.
051:             * 
052:             * @param sourceVM
053:             * @param id
054:             * @since 3.2
055:             */
056:            public VMStandin(IVMInstall sourceVM, String id) {
057:                super (sourceVM.getVMInstallType(), id);
058:                setNotify(false);
059:                init(sourceVM);
060:            }
061:
062:            /**
063:             * Construct a <code>VMStandin</code> instance based on the specified <code>IVMInstall</code>.
064:             * Changes to this standin will not be reflected in the 'real' VM until <code>convertToRealVM</code>
065:             * is called.
066:             * 
067:             * @param realVM the 'real' VM from which to construct this standin VM
068:             */
069:            public VMStandin(IVMInstall realVM) {
070:                this (realVM.getVMInstallType(), realVM.getId());
071:                init(realVM);
072:            }
073:
074:            /**
075:             * Initializes the settings of this standin based on the settings in the given
076:             * VM install.
077:             * 
078:             * @param realVM VM to copy settings from
079:             */
080:            private void init(IVMInstall realVM) {
081:                setName(realVM.getName());
082:                setInstallLocation(realVM.getInstallLocation());
083:                setLibraryLocations(realVM.getLibraryLocations());
084:                setJavadocLocation(realVM.getJavadocLocation());
085:                if (realVM instanceof  IVMInstall2) {
086:                    IVMInstall2 vm2 = (IVMInstall2) realVM;
087:                    setVMArgs(vm2.getVMArgs());
088:                    fJavaVersion = vm2.getJavaVersion();
089:                } else {
090:                    setVMArguments(realVM.getVMArguments());
091:                    fJavaVersion = null;
092:                }
093:            }
094:
095:            /**
096:             * If no corresponding 'real' VM exists, create one and populate it from this standin instance. 
097:             * If a corresponding VM exists, update its attributes from this standin instance.
098:             * 
099:             * @return IVMInstall the 'real' corresponding to this standin VM
100:             */
101:            public IVMInstall convertToRealVM() {
102:                IVMInstallType vmType = getVMInstallType();
103:                IVMInstall realVM = vmType.findVMInstall(getId());
104:                boolean notify = true;
105:
106:                if (realVM == null) {
107:                    realVM = vmType.createVMInstall(getId());
108:                    notify = false;
109:                }
110:                // do not notify of property changes on new VMs
111:                if (realVM instanceof  AbstractVMInstall) {
112:                    ((AbstractVMInstall) realVM).setNotify(notify);
113:                }
114:                realVM.setName(getName());
115:                realVM.setInstallLocation(getInstallLocation());
116:                realVM.setLibraryLocations(getLibraryLocations());
117:                realVM.setJavadocLocation(getJavadocLocation());
118:                if (realVM instanceof  IVMInstall2) {
119:                    IVMInstall2 vm2 = (IVMInstall2) realVM;
120:                    vm2.setVMArgs(getVMArgs());
121:                } else {
122:                    realVM.setVMArguments(getVMArguments());
123:                }
124:
125:                if (realVM instanceof  AbstractVMInstall) {
126:                    ((AbstractVMInstall) realVM).setNotify(true);
127:                }
128:                if (!notify) {
129:                    JavaRuntime.fireVMAdded(realVM);
130:                }
131:                return realVM;
132:            }
133:
134:            /* (non-Javadoc)
135:             * @see org.eclipse.jdt.launching.IVMInstall#getJavaVersion()
136:             */
137:            public String getJavaVersion() {
138:                return fJavaVersion;
139:            }
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.