Package eu.mosaic_cloud.components.core

Examples of eu.mosaic_cloud.components.core.ComponentCallReference


  public CallbackCompletion<Void> initialized (final ComponentController component)
  {
    Preconditions.checkState (this.component == null);
    Preconditions.checkState (this.status == Status.Created);
    this.component = component;
    final ComponentCallReference callReference = ComponentCallReference.create ();
    this.pendingReference = callReference;
    this.pendingReference = ComponentCallReference.create ();
    this.status = Status.Unregistered;
    this.component.register (this.selfGroup, this.pendingReference);
    this.logger.trace ("HDFS driver callback initialized.");
View Full Code Here


  {
    synchronized (this.monitor) {
      Preconditions.checkState (this.component == null);
      Preconditions.checkState (this.status == Status.WaitingInitialized);
      this.component = component;
      final ComponentCallReference callReference = ComponentCallReference.create ();
      this.pendingReference = callReference;
      this.status = Status.WaitingRabbitmqResolveReturn;
      this.component.call (JettyComponentContext.brokerGroup, ComponentCallRequest.create ("mosaic-rabbitmq:get-broker-endpoint", null, callReference));
    }
    return (null);
View Full Code Here

    @Override
    public final CallbackCompletion<Void> acquire (final ComponentAcquireRequest request)
    {
      Preconditions.checkNotNull (request);
      final ComponentResourceSpecification specification = request.specification;
      final ComponentCallReference reference = request.reference;
      this.execute (Transition.Executing, State.Ready, new Runnable () {
        @Override
        public final void run ()
        {
          Preconditions.checkNotNull (specification);
View Full Code Here

          final String fqdn = (String) descriptorMap.get (Token.Fqdn.string);
          descriptor = ComponentTcpSocketResourceDescriptor.create (identifier, ip, port, fqdn);
        } else
          throw (new IllegalArgumentException (String.format ("mismatched correlation attribute `%s`", correlation)));
        Preconditions.checkArgument (this.acquires.inverse ().containsKey (correlation), "mismatched correlation attribute `%s`", correlation);
        final ComponentCallReference reference = this.acquires.inverse ().remove (correlation);
        reply = ComponentAcquireReply.create (descriptor, reference);
      } else {
        final Object errorValue = message.metaData.get (Token.Error.string);
        Preconditions.checkArgument (message.metaData.containsKey (Token.Error.string), "missing error attribute");
        Preconditions.checkArgument (this.acquires.inverse ().containsKey (correlation), "mismatched correlation attribute `%s`", correlation);
        final ComponentCallReference reference = this.acquires.inverse ().remove (correlation);
        reply = ComponentAcquireReply.create (errorValue, reference);
      }
      this.componentCallbacksProxy.acquireReturned (this.componentControllerProxy, reply);
    }
View Full Code Here

      final ComponentCallReply reply;
      if (Boolean.TRUE.equals (okValue)) {
        final Object outputsValue = message.metaData.get (Token.Outputs.string);
        Preconditions.checkArgument (message.metaData.containsKey (Token.Outputs.string), "missing outputs attribute");
        Preconditions.checkArgument (this.outboundCalls.inverse ().containsKey (correlation), "mismatched correlation attribute `%s`", correlation);
        final ComponentCallReference reference = this.outboundCalls.inverse ().remove (correlation);
        reply = ComponentCallReply.create (true, outputsValue, message.data.asReadOnlyBuffer (), reference);
      } else {
        final Object errorValue = message.metaData.get (Token.Error.string);
        Preconditions.checkArgument (message.metaData.containsKey (Token.Error.string), "missing error attribute");
        Preconditions.checkArgument (this.outboundCalls.inverse ().containsKey (correlation), "mismatched correlation attribute `%s`", correlation);
        final ComponentCallReference reference = this.outboundCalls.inverse ().remove (correlation);
        reply = ComponentCallReply.create (false, errorValue, message.data.asReadOnlyBuffer (), reference);
      }
      this.componentCallbacksProxy.callReturned (this.componentControllerProxy, reply);
    }
View Full Code Here

      final Object okValue = message.metaData.get (Token.Ok.string);
      Preconditions.checkNotNull (okValue, "missing ok attribute");
      Preconditions.checkArgument (okValue instanceof Boolean, "invalid ok attribute `%s`", okValue);
      if (Boolean.TRUE.equals (okValue)) {
        Preconditions.checkArgument (this.registers.inverse ().containsKey (correlation), "mismatched correlation attribute `%s`", correlation);
        final ComponentCallReference reference = this.registers.inverse ().remove (correlation);
        this.componentCallbacksProxy.registerReturned (this.componentControllerProxy, reference, true);
      } else {
        Preconditions.checkArgument (this.registers.inverse ().containsKey (correlation), "mismatched correlation attribute `%s`", correlation);
        final ComponentCallReference reference = this.registers.inverse ().remove (correlation);
        this.componentCallbacksProxy.registerReturned (this.componentControllerProxy, reference, false);
      }
    }
View Full Code Here

  public CallbackCompletion<Void> initialized (final ComponentController component)
  {
    Preconditions.checkState (this.component == null);
    Preconditions.checkState (this.status == Status.Created);
    this.component = component;
    final ComponentCallReference callReference = ComponentCallReference.create ();
    String operation;
    if (this.driverName.equalsIgnoreCase (KeyValueDriverFactory.DriverType.RIAKPB.toString ())) {
      operation = ConfigProperties.getString ("KVDriverComponentCallbacks.2"); // $NON-NLS-1$
    } else {
      operation = ConfigProperties.getString ("KVDriverComponentCallbacks.6"); // $NON-NLS-1$
View Full Code Here

  public CallbackCompletion<Void> initialized (final ComponentController component)
  {
    Preconditions.checkState (this.component == null);
    Preconditions.checkState (this.status == Status.Created);
    this.component = component;
    final ComponentCallReference callReference = ComponentCallReference.create ();
    this.pendingReference = callReference;
    this.status = Status.WaitingResourceResolved;
    this.component.call (this.resourceGroup, ComponentCallRequest.create (ConfigProperties.getString ("AmqpDriverComponentCallbacks.2"), null, callReference)); // $NON-NLS-1$
    this.logger.trace ("AMQP driver callback initialized.");
    return null;
View Full Code Here

      CloudletComponent.this.transcript.traceDebugging ("resolving the interoperability channel endpoint for target `%s`...", target);
      // FIXME: This should be done in `Active` state
      // FIXME: This should be done in an `FsmAccess`
      final ComponentIdentifier identifier = ComponentIdentifier.resolve (target);
      final String operation = ConfigProperties.getString ("CloudletComponent.7");
      final ComponentCallReference reference = ComponentCallReference.create ();
      final ComponentCallRequest request = ComponentCallRequest.create (operation, null, reference);
      final DeferredFuture<ComponentCallReply> future = DeferredFuture.create (ComponentCallReply.class);
      CloudletComponent.this.componentPendingOutboundCalls.put (reference, future.trigger);
      CloudletComponent.this.componentControllerProxy.call (identifier, request);
      CloudletComponent.this.fsm.new FsmFutureCompletionAccess<ComponentCallReply> () {
View Full Code Here

    {
      Preconditions.checkNotNull (resource);
      CloudletComponent.this.transcript.traceDebugging ("acquiring the resource `%s`...", resource.identifier);
      // FIXME: This should be done in `Active` state
      // FIXME: This should be done in an `FsmAccess`
      final ComponentCallReference reference = ComponentCallReference.create ();
      final ComponentAcquireRequest request = ComponentAcquireRequest.create (resource, reference);
      final DeferredFuture<ComponentAcquireReply> future = DeferredFuture.create (ComponentAcquireReply.class);
      CloudletComponent.this.componentPendingAcquires.put (reference, future.trigger);
      CloudletComponent.this.componentControllerProxy.acquire (request);
      final DeferredFuture<ComponentResourceDescriptor> completionFuture = DeferredFuture.create (ComponentResourceDescriptor.class);
View Full Code Here

TOP

Related Classes of eu.mosaic_cloud.components.core.ComponentCallReference

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.