Java Doc for TargetFactory.java in  » Installer » IzPack » com » izforge » izpack » util » 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 » Installer » IzPack » com.izforge.izpack.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.izforge.izpack.util.TargetFactory

TargetFactory
public class TargetFactory (Code)
The TargetFactory serves as a central mechanism to instantiate OS specific class flavors, provide OS specific file extension types, default install directories and similar functionality. In addition it provides services that are related to OS versions and flavors. For a tutorial on using some of the features in this class see the TargetFactory Tutorial.
version:
   0.0.1 / 1/3/2002
author:
   Elmar Grom


Field Summary
final static  String[]CLASS_ARCHITECTURE_PREFIX
     The list of processor architecture specific prefixes.
final static  String[]CLASS_FLAVOR_PREFIX
     The os favor specific class prefixes for classes the implement different versions for various os favors.
final static  String[]CLASS_PREFIX
     The os specific class prefixes for classes that implement different versions for the various operating systems.
final public static  intGENERIC
     Used to report a non specific operating system.
final static  String[]INSTALL_PATH_FRAGMENT
     The list of default install path fragments.
final static  String[][]INSTALL_PATH_RESOURCE_KEY
     This is a list of keys to use when looking for resources that define the default install path to use.
final static  String[]LIBRARY_EXTENSION
     The extensions used for native libraries on various operating systems.
final public static  intNT
     Used to identify the Windows-NT class of operating systems in terms of an OS flavor.
final public static  intOTHER
     Nonspecific processor architecture, other than X86.
final public static  intSTANDARD
     This is the basic flavor for every operating system.
final public static  intUNIX
    
final public static  intWINDOWS
     Identifies Microsoft Windows.
final public static  intX
    
final public static  intX86
     Identifies Intel X86 based processor types.


Method Summary
public  intgetArchitecture()
     Returns an index number that identified the processor architecture of the target system.
public static  StringgetCurrentOSPrefix()
     Gets a prefix alias for the current platform.
public  StringgetDefaultInstallPath(String appName)
     Returns the system dependent default install path.
public static  TargetFactorygetInstance()
     Returns an instance of TargetFactory to use.
public  StringgetNativeLibraryExtension()
     Returns the file extension customarily used on the target OS for dynamically loadable libraries.
public  intgetOS()
     Returns the index number for the target operating system that was detected.
public  intgetOSFlavor()
     Returns the index number for the operating system flavor that was detected on the target system.
public  ObjectmakeObject(String name)
     This method returns an OS and OS flavor specific instance of the requested class.
public  booleanversionIsHigher(String version)
     Returns true if the version in the parameter string is higher than the version of the target os.

Field Detail
CLASS_ARCHITECTURE_PREFIX
final static String[] CLASS_ARCHITECTURE_PREFIX(Code)
The list of processor architecture specific prefixes. The string positions correspond to the architecture indexes. The following values are leegal to use :

  • X86
  • OTHER



CLASS_FLAVOR_PREFIX
final static String[] CLASS_FLAVOR_PREFIX(Code)
The os favor specific class prefixes for classes the implement different versions for various os favors. The string positions correspond to the flavor indexes. The following values are legal to use :

  • STANDARD
  • NT
  • X



CLASS_PREFIX
final static String[] CLASS_PREFIX(Code)
The os specific class prefixes for classes that implement different versions for the various operating systems. The string positions correspond to the basic operating system indexes. The following values are legal to use :

  • WINDOWS
  • MAC
  • UNIX
  • GENERIC



GENERIC
final public static int GENERIC(Code)
Used to report a non specific operating system.



INSTALL_PATH_FRAGMENT
final static String[] INSTALL_PATH_FRAGMENT(Code)
The list of default install path fragments. Depending on the operating system, a path fragment might represent either a part of the default install path or the entire path to use. For MS-Windows it is always only a part of the full install path. The string positions correspond to the basic operating system indexes. The following values are leegal to use :

  • WINDOWS
  • MAC
  • UNIX
  • GENERIC



INSTALL_PATH_RESOURCE_KEY
final static String[][] INSTALL_PATH_RESOURCE_KEY(Code)
This is a list of keys to use when looking for resources that define the default install path to use. The list is organized as two dimensional array of Strings. To access the array, denote the first dimension with the operating system index and the second dimension with the flavor index. For example to access the key for Windows-NT use INSTALL_PATH_RESOURCE_KEY[WINDOWS][NT] The array uses a sparse population, that is, not all array locations actually contain a key. Only locations for which a real operating system/flavor combination exists are populated. For example, there is no such thing as INSTALL_PATH_RESOURCE_KEY[UNIX][X]



LIBRARY_EXTENSION
final static String[] LIBRARY_EXTENSION(Code)
The extensions used for native libraries on various operating systems. The string positions correspond to the basic operating system indexes. The following values are legal to use :

  • WINDOWS
  • MAC
  • UNIX
  • GENERIC



NT
final public static int NT(Code)
Used to identify the Windows-NT class of operating systems in terms of an OS flavor. It is reported for Windows-NT, 2000 and XP.



OTHER
final public static int OTHER(Code)
Nonspecific processor architecture, other than X86.



STANDARD
final public static int STANDARD(Code)
This is the basic flavor for every operating system.



UNIX
final public static int UNIX(Code)
Identifies generic UNIX operating systems



WINDOWS
final public static int WINDOWS(Code)
Identifies Microsoft Windows.



X
final public static int X(Code)
Used to identify the OS X flavor of the Mac OS



X86
final public static int X86(Code)
Identifies Intel X86 based processor types.





Method Detail
getArchitecture
public int getArchitecture()(Code)
Returns an index number that identified the processor architecture of the target system. an index for the processor architecture
See Also:   TargetFactory.X86
See Also:   TargetFactory.OTHER



getCurrentOSPrefix
public static String getCurrentOSPrefix()(Code)
Gets a prefix alias for the current platform. "Win_" on Windows Systems "Win_NT_" on WinNT4, 2000, XP Mac on Mac Mac_X on macosx and Unix_ a prefix alias for the current platform



getDefaultInstallPath
public String getDefaultInstallPath(String appName)(Code)
Returns the system dependent default install path. This is typically used to suggest an istall path to the end user, when performing an installation. The default install path is assembled form the OS specific path fragment specified in INSTALL_PATH_FRAGMENT, possibly a drive letter and the application name. The user the option to define resources that define default paths which differ from the path fragments defined here. The following resource names will be recognized by this method:

  • TargetPanel.dir.windows
  • TargetPanel.dir.macosx
  • TargetPanel.dir.unix
  • TargetPanel.dir plus the all lower case version of System.getProperty ("os.name"), with all spaces replaced by an underscore ('_').
  • TargetPanel.dir

Parameters:
  appName - the name of the application to install. If no specific resource has been set,then this name will be appended to the OS specific default path fragment. the default install path for the target system



getInstance
public static TargetFactory getInstance()(Code)
Returns an instance of TargetFactory to use. an instance of TargetFactory.



getNativeLibraryExtension
public String getNativeLibraryExtension()(Code)
Returns the file extension customarily used on the target OS for dynamically loadable libraries. a String containing the customary library extension for the target OS.Note that the string might be empty if there no such specific extension for the target OS.



getOS
public int getOS()(Code)
Returns the index number for the target operating system that was detected. an index number for the OS
See Also:   TargetFactory.WINDOWS
See Also:   TargetFactory.UNIX
See Also:   TargetFactory.GENERIC



getOSFlavor
public int getOSFlavor()(Code)
Returns the index number for the operating system flavor that was detected on the target system. an index for the OS flavor
See Also:   TargetFactory.STANDARD
See Also:   TargetFactory.NT
See Also:   TargetFactory.X



makeObject
public Object makeObject(String name) throws Exception(Code)
This method returns an OS and OS flavor specific instance of the requested class.

Class Naming Rules
Class versions must be named with the OS and OS flavor as prefix. The prefixes are simply concatenated, with the OS prefix first and the flavor prefix second. Use the following OS specific prefixes:

Operating System Prefix
Microsoft Windows Win_
Mac OS Mac_
UNIX UNIX_

For the different OS flavors, use these prefixes:

OS Flavor Prefix
NT NT_
Mac OS X X_


Naming Example:

For the class MyClass, the specific version for Windows NT must be in the same package as MyClass and the name must be Win_NT_MyClass. A version that should be instantiated for any non-NT flavor would be called Win_MyClass. This would also be the version instantiated on Windows NT if the version Win_NT_MyClass does not exist.

The Loading Process

The process is completed after the first successful attempt to load a class.
  1. load a version that is OS and OS-Flavor specific
  2. load a version that is OS specific
  3. load the base version (without OS or OS-Flavor prefix)

See the TargetFactory Tutorial for more information.


Parameters:
  name - the fully qualified name of the class to load without the extension. An instance of the requested class. Note that specific initialization that can not beaccomplished in the default constructor still needs to be performed before the object can beused.
exception:
  Exception - if all attempts to instantiate class fail



versionIsHigher
public boolean versionIsHigher(String version) throws Exception(Code)
Returns true if the version in the parameter string is higher than the version of the target os.
Parameters:
  version - the version number to compare to false if the version of the target system is higher, otherwisetrue



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.