Package java.rmi

Examples of java.rmi.MarshalledObject$MarshalledObjectOutputStream


   }

   public void setAttribute(ObjectName objectName, Attribute attribute)
           throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, IOException
   {
      MarshalledObject attrib = RMIMarshaller.marshal(attribute);
      connection.setAttribute(objectName, attrib, delegate);
   }
View Full Code Here


   }

   public AttributeList setAttributes(ObjectName objectName, AttributeList attributes)
           throws InstanceNotFoundException, ReflectionException, IOException
   {
      MarshalledObject attribs = RMIMarshaller.marshal(attributes);
      return connection.setAttributes(objectName, attribs, delegate);
   }
View Full Code Here

   }

   public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] parameters)
           throws InstanceNotFoundException, MBeanException, ReflectionException, IOException
   {
      MarshalledObject arguments = RMIMarshaller.marshal(args);
      return connection.invoke(objectName, methodName, arguments, parameters, delegate);
   }
View Full Code Here

   }

   public Set queryMBeans(ObjectName patternName, QueryExp filter)
           throws IOException
   {
      MarshalledObject query = RMIMarshaller.marshal(filter);
      return connection.queryMBeans(patternName, query, delegate);
   }
View Full Code Here

   }

   public Set queryNames(ObjectName patternName, QueryExp filter)
           throws IOException
   {
      MarshalledObject query = RMIMarshaller.marshal(filter);
      return connection.queryNames(patternName, query, delegate);
   }
View Full Code Here

    * Returns a MarshalledObject obtained by marshalling the given object.
    */
   public static MarshalledObject marshal(Object object) throws IOException
   {
      if (object == null) return null;
      return new MarshalledObject(object);
   }
View Full Code Here

        }
        else if (obj instanceof Serializable)
        {
            try
            {
                MarshalledObject mo = new MarshalledObject(obj);
                map.put(name, mo);
            }
            catch (java.io.IOException e)
            {
                throw new NamingException("Unable to serialize object to JNDI: " + e);
View Full Code Here

    public void testEquals() throws Exception {
        String str = new String("TEST");
        String str1 = new String("TEST");
        String str2 = new String("TEST2");

        assertTrue(new MarshalledObject(str).equals(
                new MarshalledObject(str1)));
        assertTrue(! new MarshalledObject(str).equals(
                new MarshalledObject(str2)));
    }
View Full Code Here

     */
    public void testGet() throws Exception {
        Hashtable ht = new Hashtable();
        String str = new String("TEST");

        assertNull(new MarshalledObject(null).get());
        assertEquals(str, new MarshalledObject(str).get());
        ht.put(new Integer(1), str);
        ht.put(new Integer(2), "TEST1");
        MarshalledObject mo = new MarshalledObject(ht);
        assertEquals(ht, mo.get());
        ht.put(new Integer(2), "TEST2");
        assertTrue(! ht.equals(mo.get()));
    }
View Full Code Here

     */
    public void testNullLoader() throws Exception {
        ClassLoader old_cl = Thread.currentThread().getContextClassLoader();

        try {
            MarshalledObject mo = new MarshalledObject(new TestClass());
            Object obj = null;

            // 1-st get: thread context classloader is equal to system classloader
            try {
                obj = mo.get();

                if (obj.getClass().getClassLoader() != old_cl) {
                    fail("1-st get failed: loaded through: "
                            + obj.getClass().getClassLoader() + ", expected: " + old_cl);
            } else {
                System.out.println("1-st get passed.");
            }
            } catch (Exception ex) {
                fail("1-st get failed: " + ex);
            }

            // 2-nd get: thread context classloader is equal to null
            Thread.currentThread().setContextClassLoader(null);

            try {
                obj = mo.get();

                if (obj.getClass().getClassLoader() != old_cl) {
                    fail("2-nd get failed: loaded through: "
                            + obj.getClass().getClassLoader() + ", expected: " + old_cl);
                } else {
View Full Code Here

TOP

Related Classes of java.rmi.MarshalledObject$MarshalledObjectOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.