Java Code Examples for com.sun.corba.se.spi.orb.ORB#ORBInitDebug

The following examples show how to use com.sun.corba.se.spi.orb.ORB#ORBInitDebug . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServiceContextRegistry.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public ServiceContextData findServiceContextData( int scId )
{
    if (ORB.ORBInitDebug)
        dprint( "Searching registry for service context id " + scId ) ;

    Enumeration enumeration = scCollection.elements() ;
    while (enumeration.hasMoreElements()) {
        ServiceContextData scd =
            (ServiceContextData)(enumeration.nextElement()) ;
        if (scd.getId() == scId) {
            if (ORB.ORBInitDebug)
                dprint( "Service context data found: " + scd ) ;

            return scd ;
        }
    }

    if (ORB.ORBInitDebug)
        dprint( "Service context data not found" ) ;

    return null ;
}
 
Example 2
Source File: ServiceContextRegistry.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public ServiceContextData findServiceContextData( int scId )
{
    if (ORB.ORBInitDebug)
        dprint( "Searching registry for service context id " + scId ) ;

    Enumeration enumeration = scCollection.elements() ;
    while (enumeration.hasMoreElements()) {
        ServiceContextData scd =
            (ServiceContextData)(enumeration.nextElement()) ;
        if (scd.getId() == scId) {
            if (ORB.ORBInitDebug)
                dprint( "Service context data found: " + scd ) ;

            return scd ;
        }
    }

    if (ORB.ORBInitDebug)
        dprint( "Service context data not found" ) ;

    return null ;
}
 
Example 3
Source File: ServiceContextRegistry.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public ServiceContextData findServiceContextData( int scId )
{
    if (ORB.ORBInitDebug)
        dprint( "Searching registry for service context id " + scId ) ;

    Enumeration enumeration = scCollection.elements() ;
    while (enumeration.hasMoreElements()) {
        ServiceContextData scd =
            (ServiceContextData)(enumeration.nextElement()) ;
        if (scd.getId() == scId) {
            if (ORB.ORBInitDebug)
                dprint( "Service context data found: " + scd ) ;

            return scd ;
        }
    }

    if (ORB.ORBInitDebug)
        dprint( "Service context data not found" ) ;

    return null ;
}
 
Example 4
Source File: ServiceContextRegistry.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public ServiceContextData findServiceContextData( int scId )
{
    if (ORB.ORBInitDebug)
        dprint( "Searching registry for service context id " + scId ) ;

    Enumeration enumeration = scCollection.elements() ;
    while (enumeration.hasMoreElements()) {
        ServiceContextData scd =
            (ServiceContextData)(enumeration.nextElement()) ;
        if (scd.getId() == scId) {
            if (ORB.ORBInitDebug)
                dprint( "Service context data found: " + scd ) ;

            return scd ;
        }
    }

    if (ORB.ORBInitDebug)
        dprint( "Service context data not found" ) ;

    return null ;
}
 
Example 5
Source File: ServiceContextRegistry.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public ServiceContextData findServiceContextData( int scId )
{
    if (ORB.ORBInitDebug)
        dprint( "Searching registry for service context id " + scId ) ;

    Enumeration enumeration = scCollection.elements() ;
    while (enumeration.hasMoreElements()) {
        ServiceContextData scd =
            (ServiceContextData)(enumeration.nextElement()) ;
        if (scd.getId() == scId) {
            if (ORB.ORBInitDebug)
                dprint( "Service context data found: " + scd ) ;

            return scd ;
        }
    }

    if (ORB.ORBInitDebug)
        dprint( "Service context data not found" ) ;

    return null ;
}
 
Example 6
Source File: ServiceContextRegistry.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public ServiceContextData findServiceContextData( int scId )
{
    if (ORB.ORBInitDebug)
        dprint( "Searching registry for service context id " + scId ) ;

    Enumeration enumeration = scCollection.elements() ;
    while (enumeration.hasMoreElements()) {
        ServiceContextData scd =
            (ServiceContextData)(enumeration.nextElement()) ;
        if (scd.getId() == scId) {
            if (ORB.ORBInitDebug)
                dprint( "Service context data found: " + scd ) ;

            return scd ;
        }
    }

    if (ORB.ORBInitDebug)
        dprint( "Service context data not found" ) ;

    return null ;
}
 
Example 7
Source File: ServiceContextRegistry.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public ServiceContextData findServiceContextData( int scId )
{
    if (ORB.ORBInitDebug)
        dprint( "Searching registry for service context id " + scId ) ;

    Enumeration enumeration = scCollection.elements() ;
    while (enumeration.hasMoreElements()) {
        ServiceContextData scd =
            (ServiceContextData)(enumeration.nextElement()) ;
        if (scd.getId() == scId) {
            if (ORB.ORBInitDebug)
                dprint( "Service context data found: " + scd ) ;

            return scd ;
        }
    }

    if (ORB.ORBInitDebug)
        dprint( "Service context data not found" ) ;

    return null ;
}
 
Example 8
Source File: ServiceContextRegistry.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Register the ServiceContext class so that it will be recognized
 * by the read method.
 * Class cls must have the following properties:
 * <ul>
 * <li>It must derive from com.sun.corba.se.spi.servicecontext.ServiceContext.</li>
 * <li>It must have a public static final int SERVICE_CONTEXT_ID
 * member.</li>
 * <li>It must implement a constructor that takes a
 * org.omg.CORBA_2_3.portable.InputStream argument.</li>
 * </ul>
 */
public void register( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "Registering service context class " + cls ) ;

    ServiceContextData scd = new ServiceContextData( cls ) ;

    if (findServiceContextData(scd.getId()) == null)
        scCollection.addElement( scd ) ;
    else
        throw new BAD_PARAM( "Tried to register duplicate service context" ) ;
}
 
Example 9
Source File: ServiceContextRegistry.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Register the ServiceContext class so that it will be recognized
 * by the read method.
 * Class cls must have the following properties:
 * <ul>
 * <li>It must derive from com.sun.corba.se.spi.servicecontext.ServiceContext.</li>
 * <li>It must have a public static final int SERVICE_CONTEXT_ID
 * member.</li>
 * <li>It must implement a constructor that takes a
 * org.omg.CORBA_2_3.portable.InputStream argument.</li>
 * </ul>
 */
public void register( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "Registering service context class " + cls ) ;

    ServiceContextData scd = new ServiceContextData( cls ) ;

    if (findServiceContextData(scd.getId()) == null)
        scCollection.addElement( scd ) ;
    else
        throw new BAD_PARAM( "Tried to register duplicate service context" ) ;
}
 
Example 10
Source File: ServiceContextRegistry.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Register the ServiceContext class so that it will be recognized
 * by the read method.
 * Class cls must have the following properties:
 * <ul>
 * <li>It must derive from com.sun.corba.se.spi.servicecontext.ServiceContext.</li>
 * <li>It must have a public static final int SERVICE_CONTEXT_ID
 * member.</li>
 * <li>It must implement a constructor that takes a
 * org.omg.CORBA_2_3.portable.InputStream argument.</li>
 * </ul>
 */
public void register( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "Registering service context class " + cls ) ;

    ServiceContextData scd = new ServiceContextData( cls ) ;

    if (findServiceContextData(scd.getId()) == null)
        scCollection.addElement( scd ) ;
    else
        throw new BAD_PARAM( "Tried to register duplicate service context" ) ;
}
 
Example 11
Source File: ServiceContextRegistry.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Register the ServiceContext class so that it will be recognized
 * by the read method.
 * Class cls must have the following properties:
 * <ul>
 * <li>It must derive from com.sun.corba.se.spi.servicecontext.ServiceContext.</li>
 * <li>It must have a public static final int SERVICE_CONTEXT_ID
 * member.</li>
 * <li>It must implement a constructor that takes a
 * org.omg.CORBA_2_3.portable.InputStream argument.</li>
 * </ul>
 */
public void register( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "Registering service context class " + cls ) ;

    ServiceContextData scd = new ServiceContextData( cls ) ;

    if (findServiceContextData(scd.getId()) == null)
        scCollection.addElement( scd ) ;
    else
        throw new BAD_PARAM( "Tried to register duplicate service context" ) ;
}
 
Example 12
Source File: ServiceContextRegistry.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/** Register the ServiceContext class so that it will be recognized
 * by the read method.
 * Class cls must have the following properties:
 * <ul>
 * <li>It must derive from com.sun.corba.se.spi.servicecontext.ServiceContext.</li>
 * <li>It must have a public static final int SERVICE_CONTEXT_ID
 * member.</li>
 * <li>It must implement a constructor that takes a
 * org.omg.CORBA_2_3.portable.InputStream argument.</li>
 * </ul>
 */
public void register( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "Registering service context class " + cls ) ;

    ServiceContextData scd = new ServiceContextData( cls ) ;

    if (findServiceContextData(scd.getId()) == null)
        scCollection.addElement( scd ) ;
    else
        throw new BAD_PARAM( "Tried to register duplicate service context" ) ;
}
 
Example 13
Source File: ServiceContextData.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}
 
Example 14
Source File: ServiceContextData.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}
 
Example 15
Source File: ServiceContextData.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}
 
Example 16
Source File: ServiceContextData.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}
 
Example 17
Source File: ServiceContextData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}
 
Example 18
Source File: ServiceContextData.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}
 
Example 19
Source File: ServiceContextData.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}
 
Example 20
Source File: ServiceContextData.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public ServiceContextData( Class cls )
{
    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor called for class " + cls ) ;

    scClass = cls ;

    try {
        if (ORB.ORBInitDebug)
            dprint( "Finding constructor for " + cls ) ;

        // Find the appropriate constructor in cls
        Class[] args = new Class[2] ;
        args[0] = InputStream.class ;
        args[1] = GIOPVersion.class;
        try {
            scConstructor = cls.getConstructor( args ) ;
        } catch (NoSuchMethodException nsme) {
            throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;

        // get the ID from the public static final int SERVICE_CONTEXT_ID
        Field fld = null ;
        try {
            fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
        } catch (NoSuchFieldException nsfe) {
            throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
        } catch (SecurityException se) {
            throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
        }

        if (ORB.ORBInitDebug)
            dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;

        int mod = fld.getModifiers() ;
        if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
            !Modifier.isFinal(mod) )
            throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;

        if (ORB.ORBInitDebug)
            dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;

        try {
            scId = fld.getInt( null ) ;
        } catch (IllegalArgumentException iae) {
            throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
        } catch (IllegalAccessException iae2) {
            throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
        }
    } catch (BAD_PARAM nssc) {
        if (ORB.ORBInitDebug)
            dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
        throw nssc ;
    } catch (Throwable thr) {
        if (ORB.ORBInitDebug)
            dprint( "Unexpected Exception in ServiceContextData constructor: " +
                    thr ) ;
    }

    if (ORB.ORBInitDebug)
        dprint( "ServiceContextData constructor completed" ) ;
}