Java Doc for OsidLoader.java in  » ERP-CRM-Financial » sakai » edu » indiana » lib » osid » base » loader » 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 » ERP CRM Financial » sakai » edu.indiana.lib.osid.base.loader 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.indiana.lib.osid.base.loader.OsidLoader

OsidLoader
public class OsidLoader implements java.io.Serializable(Code)
OsidLoader loads a specific implementation of an Open Service Interface Definition (OSID) with its getManager method. The getManager method loads an instance of the OSID's org.osid.OsidManager, assigns the manager's OsidContext, assigns any configuration information, and returns the instance of the OSID implementation. This usage of the getManager method in the OsidLoader is how applications should bind a particular implementation to an OSID. The value of this approach is that an application can defer which specific OSID implementation is used until runtime. The specific implementation package name can then be part of the configuration information rather than being hard coded. Changing implementations is simplified with this approach.

As an example, in order to create a new Hierarchy, an application does not use the new operator. It uses the OsidLoader getManager method to get an instance of a class that implements HierarchyManager (a subclass of org.osid.OsidManager). The application uses the HierarchyManager instance to create the Hierarchy. It is the createHierarchy() method in some package (e.g. org.osid.hierarchy.impl.HierarchyManager) which uses the new operator on org.osid.hierarchy.impl.Hierarchy, casts it as org.osid.hierarchy.Hierarchy, and returns it to the application. This indirection offers the significant value of being able to change implementations in one spot with one modification, namely by using a implementation package name argument for the OsidLoader getManager method.

Sample:

org.osid.OsidContext myContext = new org.osid.OsidContext();
String key = "myKey";
myContext.assignContext(key, "I want to save this string as context");
String whatWasMyContext = myContext.getContext(key);
org.osid.hierarchy.HierarchyManager hierarchyManager =
org.osid.OsidLoader.getManager("org.osid.hierarchy.HierarchyManager","org.osid.shared.impl",myContext,null);
org.osid.hierarchy.Hierarchy myHierarchy = hierarchyManager.createHierarchy(...);

A similar technique can be used for creating other objects. OSIDs that have org.osid.OsidManager implementations loaded by OsidLoader, will define an appropriate interface to create these objects.

The arguments to OsidLoader.getManager method are the OSID org.osid.OsidManager interface name, the implementing package name, the OsidContext, and any additional configuration information.

OSID Version: 2.0

Licensed under the org.osid.SidImplementationLicenseMIT MITO.K.I. OSID Definition License .





Method Summary
public static  java.io.InputStreamgetConfigStream(String fileName, Class curClass)
     Get an InputStream for a particular file name - first check the sakai.home area and then revert to the classpath.
public static  org.osid.OsidManagergetManager(String osidPackageManagerName, String implPackageName, org.osid.OsidContext context, java.util.Properties additionalConfiguration)
     Returns an instance of the org.osid.OsidManager of the OSID specified by the OSID package org.osid.OsidManager interface name and the implementation package name. The implementation class name is constructed from the SID package Manager interface name.



Method Detail
getConfigStream
public static java.io.InputStream getConfigStream(String fileName, Class curClass)(Code)
Get an InputStream for a particular file name - first check the sakai.home area and then revert to the classpath. This is a utility method used several places.



getManager
public static org.osid.OsidManager getManager(String osidPackageManagerName, String implPackageName, org.osid.OsidContext context, java.util.Properties additionalConfiguration) throws org.osid.OsidException(Code)
Returns an instance of the org.osid.OsidManager of the OSID specified by the OSID package org.osid.OsidManager interface name and the implementation package name. The implementation class name is constructed from the SID package Manager interface name. A configuration file name is constructed in a similar manner and if the file exists it is loaded into the implementation's org.osid.OsidManager's configuration.

Example: To load an implementation of the org.osid.Filing OSID implemented in a package "xyz", one would use:

org.osid.filing.FilingManager fm = (org.osid.filing.FilingManager)org.osid.OsidLoader.getManager(

"org.osid.filing.FilingManager" ,

"xyz" ,

new org.osid.OsidContext());


Parameters:
  osidPackageManagerName - osidPackageManagerName is a fullyqualified org.osid.OsidManager interface name
Parameters:
  implPackageName - implPackageName is a fully qualifiedimplementation package name
Parameters:
  context -
Parameters:
  additionalConfiguration - org.osid.OsidManager
throws:
  org.osid.OsidException - An exception with one of the followingmessages defined in org.osid.OsidException: org.osid.OsidException.OPERATION_FAILED OPERATION_FAILED,org.osid.OsidException.NULL_ARGUMENT NULL_ARGUMENT,org.osid.OsidException.VERSION_ERROR VERSION_ERROR,=org.osid.OsidException.INTERFACE_NOT_FOUNDINTERFACE_NOT_FOUND, =org.osid.OsidException.MANAGER_NOT_FOUND MANAGER_NOT_FOUND,=org.osid.OsidException.MANAGER_INSTANTIATION_ERRORMANAGER_INSTANTIATION_ERROR, =org.osid.OsidException.ERROR_ASSIGNING_CONTEXTERROR_ASSIGNING_CONTEXT, =org.osid.OsidException.ERROR_ASSIGNING_CONFIGURATIONERROR_ASSIGNING_CONFIGURATION



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.