corba

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 » 6.0 JDK Modules com.sun » corba 
OpenJDK: corba
License:The GNU General Public License (GPL)
URL:https://openjdk.dev.java.net
Description:
Package NameComment
com.sun.corba.se.impl.activation
com.sun.corba.se.impl.copyobject
com.sun.corba.se.impl.corba
com.sun.corba.se.impl.dynamicany
com.sun.corba.se.impl.encoding
com.sun.corba.se.impl.interceptors
com.sun.corba.se.impl.io
com.sun.corba.se.impl.ior
com.sun.corba.se.impl.ior.iiop
com.sun.corba.se.impl.javax.rmi
com.sun.corba.se.impl.javax.rmi.CORBA
com.sun.corba.se.impl.legacy.connection
com.sun.corba.se.impl.monitoring
com.sun.corba.se.impl.naming.cosnaming
com.sun.corba.se.impl.naming.namingutil
com.sun.corba.se.impl.naming.pcosnaming
com.sun.corba.se.impl.oa
com.sun.corba.se.impl.oa.poa
com.sun.corba.se.impl.oa.toa
com.sun.corba.se.impl.orb
com.sun.corba.se.impl.orbutil
com.sun.corba.se.impl.orbutil.closure
com.sun.corba.se.impl.orbutil.concurrent
com.sun.corba.se.impl.orbutil.fsm
com.sun.corba.se.impl.orbutil.graph
com.sun.corba.se.impl.orbutil.threadpool
com.sun.corba.se.impl.presentation.rmi
com.sun.corba.se.impl.protocol
com.sun.corba.se.impl.protocol.giopmsgheaders
com.sun.corba.se.impl.resolver
com.sun.corba.se.impl.transport
com.sun.corba.se.impl.util
com.sun.corba.se.internal.corba
com.sun.corba.se.internal.CosNaming
com.sun.corba.se.internal.iiop
com.sun.corba.se.internal.Interceptors
com.sun.corba.se.internal.io
com.sun.corba.se.internal.POA
com.sun.corba.se.org.omg.CORBA
com.sun.corba.se.pept.broker
com.sun.corba.se.pept.encoding
com.sun.corba.se.pept.protocol
com.sun.corba.se.pept.transport
com.sun.corba.se.spi.copyobject
com.sun.corba.se.spi.encoding
com.sun.corba.se.spi.extension
com.sun.corba.se.spi.ior

Provides access to the components and profiles in an IOR without the overhead of CDR encoding.

The abstract model of IORs works as follows:

  • An IOR has a type ID string, and contains TaggedProfile instances.
  • An IIOPProfile isA TaggedProfile.
  • An IIOPProfile is composed of an IIOPProfileTemplate and an object ID.
  • An IIOPProfileTemplate has an ObjectKeyTemplate, and contains TaggedComponents.
  • A TaggedComponent has an ID, and can be written to an OuputStream.
  • A TaggedComponentFactory reads a TaggedComponent from an InputStream.

In all cases, containment is represented by having the appropriate interface (IOR and IIOPProfileTemplate above) extend java.util.List. This makes it easy to use all of the facilities in the Java collections framework with IORs. However, note that all objects available through these APIs are immutable. Thus all list update operations through UnsupportedOperationException, and list iterators cannot modify the underlying list.

Templates are used because the basic object adapter model for object creation is to establish all properties of an IOR (except for type and object ID) when the object adapter is created. This has been present for the POA essentially from the beginning, since policies can only be passed to create_POA, and cannot be changed on an existing POA. The Portable Interceptors work has also made this clear, since the IOR interceptor runs only when an object adapter is created, which is the only time that user code can add tagged components to an IOR.

com.sun.corba.se.spi.ior.iiop
com.sun.corba.se.spi.legacy.connection
com.sun.corba.se.spi.legacy.interceptor
com.sun.corba.se.spi.logging
com.sun.corba.se.spi.monitoring package General Information

Monitoring Framework SPI's is used internally by the ORB to instrument for JMX based Management and Monitoring. The
framework is very generic and easy to use and acts as facade to retrieve the information from the running CORBA system.

This framework helps in building a nice Hierarchical Structure of Monitored Objects that contains Monitored Attributes.
com.sun.corba.se.spi.orb.ORB has an API to get the RootMonitoredObject and then User can traverse through the tree to
either instrument or retrieve the information for Monitoring.

Code Snippet to Instrument Connection Monitored Object

This example shows on how to instrument CorbaConnectionImpl 's attributes. It exposes two
attributes, namely

1. Connection State
2. Response time statistics to Appeserver Admin Console or CLI
 

1. Instrumenting Connection State

/**
 *  Code Snippet to Instrument Connection Monitored Object with
 *  ConnectionState Monitored Attribute. Steps to follow
 *
 *  Step 1: Define a Monitored Attribute (ConnectionStateMonitoredAttribute) Class by extending
 *               StringMonitoredAttributeBase
 *
 *  Step 2: Create Connection Manager Monitored Object and add that to
 *                Root Monitored Object.
 *
 *  Step 3: Create Connection Monitored Object  and add it to Connection Manager Monitored Object
 *
 *  Step 4: Instantiate Concrete Attribute (ConnectionStateMonitoredAttribute) Class and add that to
 *                the Connection MonitoredObject
 *
 *  Step 5: Adds ConnectionMonitoredObject to ConnectionManagerMonitoredObject
 *
 */

/**
  *  Step 1: Define a Monitored Attribute Class by extending
  *                StringMonitoredAttributeBase
  */

/**
  *  ConnectionState gets the value on demand.
  */
#import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase
#import com.sun.corba.se.spi.transport.CorbaConnection;

public class ConnectionStateMonitoredAttribute extends StringMonitoredAttributeBase
{
    CorbaConnection connection;
    public ConnectionInUseMonitoredAttribute( String name, String desc,
        CorbaConnection con )
    {
        super( name, desc );
        connection = con;
    }

    public Object getValue( ) {
        // Delegate the getValue call to connection
        // so, there is no state maintained in this attribute object itself
        // and also the locking will be the responsibility of Connection
        // Object. By doing this we will avoid global locking and possibly
        // avoiding the bottleneck
        return connection.getState( );
    }

    // IMPORTANT: In this case we don't have to implement clearState() method
    // If there is a need to implement this method like for POACounter, the
    // call again can be delegated to the Object which maintains the real
    // state. clearState() is invoked whenever there is a call to CORBAMBean.startMonitoring()
}
 

/**
 *  Step 2: Create Connection Manager Monitored Object and add that to
 *          Root Monitored Object.
 */
import com.sun.corba.se.spi.monitoring.MonitoringFactories;
import com.sun.corba.se.spi.monitoring.MonitoredObject;

private static MonitoredObject connectionManagerMonitoredObject;
private static MonitoredObject connectionMonitoredObject;
 

    private void instrumentConnectionManager( ) {
        connectionManagerMonitoredObject =
            MonitoringFactories.getMonitoredObjectFactory().createMonitoredObject(
                "ConnectionManagerMonitoredObject",
                "Used to Monitor the stats on All IIOP Connections " );
        orb.getRootMonitoredObject().addChild(connectionManagerMonitoredObject );
    }
 

/**
  *  Step 3: Create Connection Monitored Object  and add it to Connection Manager Monitored Object
  *
  *  Step 4: Instantiate Concrete Attribute (ConnectionStateMonitoredAttribute) Class and add that to
  *                the Connection MonitoredObject
  *
  *  Step 5: Add ConnectionMonitoredObject to ConnectionManagerMonitoredObject
  */
private void instrumentConnectionObject( CorbConnection connection ) {
    // Step 3
    MonitoredObject connectionMonitoredObject =
        MonitoringFactories.getMonitoredObjectFactory().createMonitoredObject(
            connection.getName(),
            "Used to Monitor the stats on one connection" );
    // Step 4
    ConnectionStateMonitoredAttribute connectionState =
        new ConnectionStateMonitoredAttribute( "Connection_State",
            "Provides the state of the IIOP Connection ...",  connection );
    connectionMonitoredObject.addAttribute( connectionState );
    // Step 5
    connectionManagerMonitoredObject.addChild( connectionMonitoredObject );
}
 
 

Code Snippet to Instrument A Statistic Type Monitored Attribute

/**
  *  Assuming ConnectionMonitoredObject is already added to the MonitoredObject Hierarchy.
  *  This example code shows how to instrument ConnectionMonitoredObject with a new
  *   StatisticMonitoredAttribute.
  *
  *    IMPORTANT: StatisticsMonitoredAttribute is mostly write mostly and read sparingly, i.e.,
  *    the frequency of writes(Collecting samples) is high.  It is the responsibility of user to synchronize
  *    the sample() method and the StatisticMonitoredAttribute will synchronize clearState() and
  *    getValue() using the mutex object sent.
  */
private void instrumentStatsToConnectionObject( MonitoredObject connectionMonitoredObject  ) {
     // Step 4
    StatisticsAccumulator connectRequestStatsAccumulator =
        // Microseconds is the unit used for statistics measure
        new StatisticsAccumulator( "Micro Seconds" );

    // Pass Name, Description, Statistic Accumulator Instance, Mutex (The
    // Object on which we need to synchronize for stats sample collection)
    StatisticMonitoredAttribute sm = new StatisticMonitoredAttribute(
        connection.getName() + "Stats",
        "Connection Request Stats", connectRequestStatsAccumulator, this );

    connectionMonitoredObject.addAttribute( sm );
 

    // Now, The user can accumulate the samples by calling into
    // connectRequestStatsAccumulator.sample( <value> );
    // Finally When ASAdmin request for the value of this Stats Monitored Attribute
    // by using standard getValue() call. It will return a formatted Stats Value like
    //  For Example
    //
    //  Minimum Value = 200 Microseconds
    //  Maximum Value = 928 Microseconds
    //  Average Value = 523 Microseconds
    //  Standard Deviation = 53.72 Microseconds
    //  Sample Collected = 435

}

Caution On Global Locking (Synchronization):

It's important to make sure that collecting Stats and other state information for monitoring doesn't impact performance. Please look at the following don'ts
to understand better.

Do not add a special mutex for synchronizing MonitoredObject:
Let's take an example of exposing a counter that counts Requests on this connection and 2 possible ways of doing this
1. Define Counter by extending LongMonitoredAttributeBase
     public class Counter extends LongMonitoredAttributeBase {
        private long counter;
 
        Counter( String name, String desc ) {
            super( name, desc );
        }
 
         public synchronized void increment( ) {
              counter++;
         }

          public synchronized Object getValue( ) {
              return new Long( counter );
          }
    }
 

2. Or Define a RequestCounter by extending LongMonitoredAttributeBase again, but no special
    synchronization is done

    public class RequestCounter extends LongMonitoredAttributeBase {
        private CorbaConnection connection;
        RequestCounter( String name, String desc, CorbaConnection con ) {
            super( name, desc );
            connection = con;
        }

        public Object getValue( ) {
            return connection.getRequestCount( );
       }
    }

    The problem with Alternative (1) is that there may be unneccesary extra synchronization happening for every method and it may become a bottle neck
     particularly if this object is accessed quite often. In Alternative (2), the synchronization happens only in the Connection object and no special sync
     is required in the RequestCounter object.
 

Important Thing To Know On StatisticMonitoredAttribute type:
The clearState() and getValue() call will be synchronized using the mutex passed by the external object, but sample() method in StatisticsAccumulator
is not synchronized. It is the responsibility of user to synchronize to make sure that the samples collected (The mutex passed into the StatisticsAccumulator must be the one used to synchronize calls to sample() ).
 

@since JDK1.5 @serial exclude

com.sun.corba.se.spi.oa
com.sun.corba.se.spi.orb
com.sun.corba.se.spi.orbutil.closure
com.sun.corba.se.spi.orbutil.fsm
com.sun.corba.se.spi.orbutil.proxy
com.sun.corba.se.spi.orbutil.threadpool
com.sun.corba.se.spi.presentation.rmi
com.sun.corba.se.spi.protocol
com.sun.corba.se.spi.resolver
com.sun.corba.se.spi.servicecontext
com.sun.corba.se.spi.transport
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.