Package net.jini.io

Examples of net.jini.io.MarshalledInstance$ToMOInputStream


    // Inherit java doc from super type
    public Lease[] getLeases() throws LeaseUnmarshalException, RemoteException
    {
  try {
      GetLeasesResult result = server.getLeases(uuid);
      MarshalledInstance mls[] = result.marshalledLeases;

      if (mls == null || mls.length == 0)
    return new Lease[0];
     
      final List leases = new LinkedList();
      final List problems = new LinkedList();
      final List exceptions = new LinkedList();
      for (int i=0; i<mls.length; i++) {
    Lease l;
    final MarshalledInstance ml = mls[i];
    try {
        l = (Lease) ml.get(result.verifyCodebaseIntegrity());
        leases.add(l);
    } catch (Throwable t) {
        problems.add(ml.convertToMarshalledObject());
        exceptions.add(t);
    }   
      }

      final Lease[] rslt =
View Full Code Here


  stub.test();
  // give server side a chance to really finish the call
  Thread.sleep(5000);
  wrstub = new WeakReference(stub);
  // cause stub to be marshalled and unmarshalled to force dirty call
  (new MarshalledInstance(stub)).get(false);
  stub = null;
  flushRefs();
  // check that nothing holds onto the stub
  if (wrstub.get() != null) {
      throw new RuntimeException("stub held onto");
View Full Code Here

      int port = socket.getPort();

      // read LUS proxy
      ObjectInputStream oin = new ObjectInputStream(
    new BufferedInputStream(socket.getInputStream()));
      MarshalledInstance mi =
    new MarshalledInstance((MarshalledObject) oin.readObject());
      ServiceRegistrar reg =
    (ServiceRegistrar) mi.get(defaultLoader, false, null, context);

      // read LUS member groups
      int ngroups = oin.readInt();
      if (ngroups < 0) {
    throw new DiscoveryProtocolException(
View Full Code Here

  // write LUS proxy
  ObjectOutputStream oout = new ObjectOutputStream(
      new BufferedOutputStream(socket.getOutputStream()));
  oout.writeObject(
      new MarshalledInstance(
    response.getRegistrar(), context).convertToMarshalledObject());

  // write LUS member groups
  String[] groups = response.getGroups();
  oout.writeInt(groups.length);
View Full Code Here

  set = leaseSet;

  clientLeaseExpiration = clientLease.getExpiration();
  clientLease.setSerialFormat(Lease.ABSOLUTE);
  marshalledClientLease = new MarshalledInstance(clientLease);

  this.renewDuration = renewDuration;
  calcMembershipExpiration(membershipDuration, now);
    }
View Full Code Here

      // stale) pre-marshalled lease we already have
      return marshalledClientLease;
  } else {
      try {
    cl.setSerialFormat(Lease.DURATION);
    return new MarshalledInstance(cl);
      } catch (IOException e) {
    // Can't create a new MarshalledInstance, return the old one
    return marshalledClientLease;
      } finally {
    cl.setSerialFormat(Lease.ABSOLUTE);
View Full Code Here

  // and we don't have it quite right...maybe writeObject should
  // clear the  flag instead of explicit clearing it after writing
  // the clw out?).  Not clear doing it here is significantly less
  // efficient.
  try {
      marshalledClientLease = new MarshalledInstance(clientLease);
  } catch (IOException e) {
      // $$$ Besides printing a message drop this on the floor,
      // exception in some pathological cases we are extremely
      // unlikely to get this exception, further more this is really
      // just a logging error, which our current policy is to drop.
View Full Code Here

     * @param source Source object for the event
     * @throws IOException if the client lease could not be pre
     * marshalled.
     */
    EventFactory newFailureFactory(LeaseRenewalSet source) throws IOException {
  final MarshalledInstance ml = getMarshalledClientLease();

  MarshalledInstance mt = null;
  if (lastFailure != null)
      mt = new MarshalledInstance(lastFailure);

  return new FailureFactory(source, ml, mt);
    }
View Full Code Here

        int i = 0;
        int nMarshalledRegs = marshalledRegs.size();
        for(int n=0;n<nMarshalledRegs;n++) {
            MarshalledObject marshalledObj
                                  = (MarshalledObject)(marshalledRegs.get(i));
            MarshalledInstance marshalledInstance
                                  =  new MarshalledInstance(marshalledObj);
            try {
                ServiceRegistrar reg =
                         (ServiceRegistrar)(marshalledInstance.get(integrity));
                /* Success: record the un-marshalled element
                 *          delete the corresponding un-marshalled element
                 */
                unmarshalledRegs.add( reg );
                marshalledRegs.remove(i);
View Full Code Here

         *  is returned.
         */
  private boolean sameVersion(ServiceItem item0,ServiceItem item1) {
            boolean fullyEqual = false;
            try {
                MarshalledInstance mi0 = new MarshalledInstance(item0.service);
                MarshalledInstance mi1 = new MarshalledInstance(item1.service);
                fullyEqual = mi0.fullyEquals(mi1);
            } catch(IOException e) {
                logger.log(Level.INFO, "failure marshalling old and new "
                           +"services for equality check", e);
            }
View Full Code Here

TOP

Related Classes of net.jini.io.MarshalledInstance$ToMOInputStream

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.