Java Code Examples for javax.rmi.CORBA.Util#writeRemoteObject()

The following examples show how to use javax.rmi.CORBA.Util#writeRemoteObject() . These examples are extracted from open source projects. 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
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 2
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 3
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 4
Source Project: JDKSourceCode1.8   File: IIOPOutputStream.java    License: MIT License 4 votes vote down vote up
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 5
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 6
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 7
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 8
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 9
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}
 
Example 10
private void writeObjectField(ObjectStreamField field,
                              Object objectValue) throws IOException {

    if (ObjectStreamClassCorbaExt.isAny(field.getTypeString())) {
        javax.rmi.CORBA.Util.writeAny(orbStream, objectValue);
    }
    else {
        Class type = field.getType();
        int callType = ValueHandlerImpl.kValueType;

        if (type.isInterface()) {
            String className = type.getName();

            if (java.rmi.Remote.class.isAssignableFrom(type)) {

                // RMI Object reference...

                callType = ValueHandlerImpl.kRemoteType;


            } else if (org.omg.CORBA.Object.class.isAssignableFrom(type)){

                // IDL Object reference...
                callType = ValueHandlerImpl.kRemoteType;

            } else if (RepositoryId.isAbstractBase(type)) {
                // IDL Abstract Object reference...
                callType = ValueHandlerImpl.kAbstractType;
            } else if (ObjectStreamClassCorbaExt.isAbstractInterface(type)) {
                callType = ValueHandlerImpl.kAbstractType;
            }
        }

        switch (callType) {
        case ValueHandlerImpl.kRemoteType:
            Util.writeRemoteObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kAbstractType:
            Util.writeAbstractObject(orbStream, objectValue);
            break;
        case ValueHandlerImpl.kValueType:
            try{
                orbStream.write_value((java.io.Serializable)objectValue, type);
            }
            catch(ClassCastException cce){
                if (objectValue instanceof java.io.Serializable)
                    throw cce;
                else
                    Utility.throwNotSerializableForCorba(objectValue.getClass().getName());
            }
        }
    }
}