Java Code Examples for org.omg.CORBA.CustomMarshal

The following are top voted examples for showing how to use org.omg.CORBA.CustomMarshal. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 2
Project: openjdk-jdk10   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 3
Project: openjdk9   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 4
Project: lookaside_java-1.8.0-openjdk   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 5
Project: jdk8u_corba   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 6
Project: javify   File: Vio.java   View source code 6 votes vote down vote up
/**
 * Try to write value supposing that it implements self-streamable interfaces.
 * Return false if it does not or true on success.
 */
static boolean writeSelf(OutputStream output, Serializable value)
{
  // User defined write method is present.
  if (value instanceof CustomMarshal)
    {
      ((CustomMarshal) value).marshal((DataOutputStream) output);
      return true;
    }
  else if (value instanceof Streamable)
    {
      ((Streamable) value)._write(output);
      return true;
    }
  return false;
}
 
Example 7
Project: jvm-stm   File: Vio.java   View source code 6 votes vote down vote up
/**
 * Try to write value supposing that it implements self-streamable interfaces.
 * Return false if it does not or true on success.
 */
static boolean writeSelf(OutputStream output, Serializable value)
{
  // User defined write method is present.
  if (value instanceof CustomMarshal)
    {
      ((CustomMarshal) value).marshal((DataOutputStream) output);
      return true;
    }
  else if (value instanceof Streamable)
    {
      ((Streamable) value)._write(output);
      return true;
    }
  return false;
}
 
Example 8
Project: infobip-open-jdk-8   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 9
Project: openjdk-source-code-learn   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 10
Project: OLD-OpenJDK8   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 11
Project: JamVM-PH   File: Vio.java   View source code 6 votes vote down vote up
/**
 * Try to write value supposing that it implements self-streamable interfaces.
 * Return false if it does not or true on success.
 */
static boolean writeSelf(OutputStream output, Serializable value)
{
  // User defined write method is present.
  if (value instanceof CustomMarshal)
    {
      ((CustomMarshal) value).marshal((DataOutputStream) output);
      return true;
    }
  else if (value instanceof Streamable)
    {
      ((Streamable) value)._write(output);
      return true;
    }
  return false;
}
 
Example 12
Project: openjdk-orb   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 13
Project: classpath   File: Vio.java   View source code 6 votes vote down vote up
/**
 * Try to write value supposing that it implements self-streamable interfaces.
 * Return false if it does not or true on success.
 */
static boolean writeSelf(OutputStream output, Serializable value)
{
  // User defined write method is present.
  if (value instanceof CustomMarshal)
    {
      ((CustomMarshal) value).marshal((DataOutputStream) output);
      return true;
    }
  else if (value instanceof Streamable)
    {
      ((Streamable) value)._write(output);
      return true;
    }
  return false;
}
 
Example 14
Project: openjdk-icedtea7   File: CDROutputStream_1_0.java   View source code 6 votes vote down vote up
private void writeIDLValue(Serializable object, String repID)
{
    if (object instanceof StreamableValue) {
        ((StreamableValue)object)._write(parent);

    } else if (object instanceof CustomValue) {
        ((CustomValue)object).marshal(parent);

    } else {
        BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
        boolean isCustom = false;
        if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
            try {
                if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
                    isCustom = true;
            } catch(BadKind ex) {
                throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
                    ex ) ;
            }
        }
        if (isCustom)
            ((CustomMarshal)object).marshal(parent);
        else
            helper.write_value(parent, object);
    }
}
 
Example 15
Project: javify   File: ValueHandlerDelegateImpl.java   View source code 4 votes vote down vote up
/**
 * Checks if an instance of this class can write its fields itself.
 */
public boolean isCustomMarshaled(Class clz)
{
  return CustomMarshal.class.isAssignableFrom(clz)
    || Streamable.class.isAssignableFrom(clz);
}
 
Example 16
Project: jvm-stm   File: ValueHandlerDelegateImpl.java   View source code 4 votes vote down vote up
/**
 * Checks if an instance of this class can write its fields itself.
 */
public boolean isCustomMarshaled(Class clz)
{
  return CustomMarshal.class.isAssignableFrom(clz)
    || Streamable.class.isAssignableFrom(clz);
}
 
Example 17
Project: JamVM-PH   File: ValueHandlerDelegateImpl.java   View source code 4 votes vote down vote up
/**
 * Checks if an instance of this class can write its fields itself.
 */
public boolean isCustomMarshaled(Class clz)
{
  return CustomMarshal.class.isAssignableFrom(clz)
    || Streamable.class.isAssignableFrom(clz);
}
 
Example 18
Project: classpath   File: ValueHandlerDelegateImpl.java   View source code 4 votes vote down vote up
/**
 * Checks if an instance of this class can write its fields itself.
 */
public boolean isCustomMarshaled(Class clz)
{
  return CustomMarshal.class.isAssignableFrom(clz)
    || Streamable.class.isAssignableFrom(clz);
}