Retrieves a request from the buffer and forwards it to the {@link TalendESBJob job} requesting it.

@return the request retrieved from the buffer
559071
@Override
    public Object getRequest() throws ESBJobInterruptedException {
        try {
            currentExchange = messageExchanges.take();
        } catch (BufferStoppedException e) {
            Thread.currentThread().interrupt();
            throw new ESBJobInterruptedException("Job canceled.");
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new ESBJobInterruptedException("Job canceled.");
        }
        return currentExchange.getRequest();
    }
984732
public synchronized Object getNextJob()
    {
        Object strJobDef = null;
        synchronized (this)
        {
            if (m_vPrivateJobs.size() > 0)
                strJobDef = m_vPrivateJobs.remove(0);
        }
        return strJobDef;
    }
1054091
protected HttpURLConnection getConnection() {
        try {
            HttpURLConnection connection;
            if (proxy != null) {
                connection = (HttpURLConnection) sentryUrl.openConnection(proxy);
            } else {
                connection = (HttpURLConnection) sentryUrl.openConnection();
            }

            if (bypassSecurity && connection instanceof HttpsURLConnection) {
                ((HttpsURLConnection) connection).setHostnameVerifier(NAIVE_VERIFIER);
            }
            connection.setRequestMethod("POST");
            connection.setDoOutput(true);
            connection.setConnectTimeout(connectionTimeout);
            connection.setReadTimeout(readTimeout);
            connection.setRequestProperty(USER_AGENT, SentryEnvironment.getSentryName());
            connection.setRequestProperty(SENTRY_AUTH, getAuthHeader());

            if (marshaller.getContentType() != null) {
                connection.setRequestProperty("Content-Type", marshaller.getContentType());
            }

            if (marshaller.getContentEncoding() != null) {
                connection.setRequestProperty("Content-Encoding", marshaller.getContentEncoding());
            }

            return connection;
        } catch (IOException e) {
            throw new IllegalStateException("Couldn't set up a connection to the Sentry server.", e);
        }
    }
590261
@Override
    public java.util.concurrent.Future<ListJobsResult> listJobsAsync(com.amazonaws.handlers.AsyncHandler<ListJobsRequest, ListJobsResult> asyncHandler) {

        return listJobsAsync(new ListJobsRequest(), asyncHandler);
    }
1062422
@Override
  public JobID getNewJobId() throws IOException {
    int value = jobCounter.incrementAndGet();
    if (value > 1) {
      throw new RuntimeException(
        "CoronaJobTracker can only run one job! (value=" + value + ")");
    }
    createSession();
    // the jobtracker can run only a single job. it's jobid is fixed based
    // on the sessionId.
    jobId = jobIdFromSessionId(sessionId);
    return jobId;
  }
696183
public synchronized byte[] getBuffer() {
        byte[] dest = new byte[buf.length];
        System.arraycopy(buf, 0, dest, 0, dest.length);
        return dest;
    }
1066519
public GetThumbnailJobResponse getThumbnailJob(String jobId) {
        GetThumbnailJobRequest request = new GetThumbnailJobRequest().withJobId(jobId);
        
        return getThumbnailJob(request);
    }
438162
public java.lang.String getRequestUrl() {
    java.lang.Object ref = requestUrl_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      requestUrl_ = s;
      return s;
    }
  }
292664
public ServletRequest getServletRequest()
    {
        RequestContext reqContext = peekRequestContext();
        if (reqContext == null)
            return null;

        return  reqContext._request;
    }
1334280
public HttpServletRequest getRequest()
    {
    	//    	moved as part of 	LIDB-3598 to ServletUtil
    	/*
        ServletRequest r = _req;
        
        while (!(r instanceof HttpServletRequest))
        {
            if (r instanceof ServletRequestWrapper)
            {
                r = ((ServletRequestWrapper) r).getRequest();
            }
        }
			    
        return (HttpServletRequest) r;
        */
    	//begin 311003, 61FVT:Simple SIP request generating exception
    	ServletRequest sReq = null;
    	if (_req==null)
    		return null;
    	try {
    		sReq = ServletUtil.unwrapRequest(_req);
    	}
    	catch (RuntimeException re){
    		if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))
    			logger.logp(Level.FINE, CLASS_NAME,"getRequest","Caught RuntimeException unwrapping the request",re);
    		return null;
    	}
    	//end 311003, 61FVT:Simple SIP request generating exception
    	if (sReq instanceof HttpServletRequest)
    		return (HttpServletRequest) sReq;
    	else 
    		return null;
    }
957265
public Object tryGet() {
        Object o = null;

        if (head != null) {
            o = head.getContents();
            head = head.getNext();
            count--;

            if (head == null) {
                tail = null;
                count = 0;
            }
        }

        return o;
    }
1184316
public com.google.protobuf.ByteString
      getJobNameBytes() {
    java.lang.Object ref = jobName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      jobName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1224775
public T acquire() {
        T t = pool.poll();
        if (t == null) {
            t = create();
            ++count;
        }
        ++requests;
        // log();
        return t;
    }
1181287
@Path("{id}")
  @GET
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public Optional<Job> get(@InjectParam @PathParam("id") @Valid final JobId id) {
    if (!id.isFullyQualified()) {
      throw badRequest("Invalid id");
    }
    return Optional.fromNullable(model.getJob(id));
  }
290682
@Override
    public JobDetail retrieveJob(final JobKey jobKey) throws JobPersistenceException {
        return doWithLock(new LockCallback<JobDetail>() {
            @Override
            public JobDetail doWithLock(JedisCommands jedis) throws JobPersistenceException {
                try {
                    return storage.retrieveJob(jobKey, jedis);
                } catch (ClassNotFoundException e) {
                    throw new JobPersistenceException("Error retrieving job: " + e.getMessage(), e);
                }
            }
        }, "Could not retrieve job.");
    }
695908
@VisibleForTesting
    boolean runNextJob() {
        try {
            Queue<Message> messages = _messageSupplier.get();
            Message message;

            while ((message = messages.poll()) != null) {
                String jobIdString = (String) message.getPayload();

                // If this job has recently reported that it cannot run on this server then skip it.
                Instant now = Instant.now();
                Instant delayUntilTime = _recentNotOwnerDelays.get(jobIdString, EPOCH);
                if (now.isBefore(delayUntilTime)) {
                    _log.debug("Waiting {} for next attempt to run job locally: {}",
                            Duration.between(now, delayUntilTime), jobIdString);
                    continue;
                }

                InterProcessMutex mutex = getMutex(jobIdString);

                if (!acquireMutex(mutex)) {
                    _log.debug("Failed to get mutex for job {}", jobIdString);
                    continue;
                }
                try {
                    String jobTypeName = getJobTypeNameFromId(jobIdString);
                    RegistryEntry<?, ?> entry = _jobHandlerRegistry.getRegistryEntry(jobTypeName);

                    _log.info("Executing job {}... ", jobIdString);

                    boolean ranLocally = run(jobIdString, entry);

                    if (ranLocally) {
                        acknowledgeQueueMessage(message.getId());
                        _log.info("Executing job {}... DONE", jobIdString);
                    } else {
                        // The job self-reported it could not be run locally.  Cache that knowledge and wait before
                        // attempting this job again.
                        _recentNotOwnerDelays.put(jobIdString, Instant.now().plus(_notOwnerRetryDelay));
                        _recentNotOwnerDelays.cleanUp();
                        _log.info("Executing job {}... not local", jobIdString);
                    }
                } finally {
                    mutex.release();
                }

                return true;
            }

            _log.debug("Job queue was empty or contained only non-local jobs");
        } catch (Throwable t) {
            _log.warn("runNextJob failed unexpectedly", t);
        }

        return false;
    }
1357962
public synchronized Object get() {
        Object o = null;

        while ((o = tryGet()) == null) {
            try {
                this.wait();
            } catch (final InterruptedException e) {
            }
        }
        return o;
    }