Examples of Context


Examples of javax.context.Context

    @SuppressWarnings("unchecked")
    public void notify(T event)
    {
        AbstractComponent<?> baseComponent = (AbstractComponent<?>) bean;
        Object object = null;
        Context context = null;
        boolean isDependentContext = false;

        try
        {
            if (baseComponent.getScopeType().equals(Dependent.class))
            {
                isDependentContext = true;
                ContextFactory.getDependentContext().setActive(true);               
            }

            context = manager.getContext(baseComponent.getScopeType());
           
            if (ifExist)
            {
                object = context.get(baseComponent);
            }
            else
            {
                object = context.get((AbstractComponent<T>)baseComponent, new CreationalContextImpl<T>());
            }

            if (object != null)
            {
                Object[] args = null;
View Full Code Here

Examples of javax.enterprise.context.spi.Context

    }

    @Override
    public Object getSessionBeanProxy(Bean<?> bean, Class<?> interfce, CreationalContext<?> creationalContext) {

        final Context context = webBeansContext.getBeanManagerImpl().getContext(bean.getScope());

        final CreationalContext<Object> cc = (CreationalContext<Object>) creationalContext;
        final Contextual<Object> component = (Contextual<Object>) bean;

        return context.get(component, cc);

    }
View Full Code Here

Examples of javax.naming.Context

    * @param queueJNDI name of the queue destination to look up
    */
   public JmsReceiver() throws JMSException, NamingException {

      // Get the initial context
      Context jndicontext = getInitialContext();

      // Get the connection factory
      QueueConnectionFactory queueFactory =
   (QueueConnectionFactory)jndicontext.lookup("ConnectionFactory");

      // Create the connection
      queueConnection = queueFactory.createQueueConnection();

      // Create the session with: No transaction and Auto ack
      queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      // Look up the destination
      queue = (Queue)jndicontext.lookup(queueJNDI);

      // Create a subsriber
      queueReceiver = queueSession.createReceiver(queue);

      // Set the message listener, which is this class since we implement
View Full Code Here

Examples of javax.validation.MessageInterpolator.Context

    public FacesMessage interpolateMessage(FacesContext context, final ConstraintDescriptor<? extends Annotation> constrain) {
        if (constrain.getAttributes().containsKey("message")) {
            Object object = constrain.getAttributes().get("message");
            String interpolatedMessage;
            interpolatedMessage = validatorFactory.getMessageInterpolator().interpolate(object.toString(), new Context() {
                public Object getValidatedValue() {
                    return "{9}";
                }

                public ConstraintDescriptor<?> getConstraintDescriptor() {
View Full Code Here

Examples of javax.ws.rs.core.Context

        PathParam path = null;
        QueryParam query = null;
        HeaderParam header = null;
        CookieParam cookie = null;
        FormParam form = null;
        Context context = null;

        Injectable injectable = null;
        int annotationsCounter = 0;
        for (int i = 0; i < annotations.length; ++i) {
            if (annotations[i].annotationType().equals(MatrixParam.class)) {
View Full Code Here

Examples of jp.vmi.selenium.selenese.Context

    }

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        TestSuite testSuite = (TestSuite) invocation.getThis();
        Context context = (Context) invocation.getArguments()[CONTEXT];
        testSuite.setWebDriverName(context.getWrappedDriver().getClass().getSimpleName());
        JUnitResult jUnitResult = (context instanceof JUnitResultHolder) ? ((JUnitResultHolder) context).getJUnitResult() : null;
        HtmlResult htmlResult = (context instanceof HtmlResultHolder) ? ((HtmlResultHolder) context).getHtmlResult() : null;
        StopWatch sw = testSuite.getStopWatch();
        LogRecorder slr = new LogRecorder(context.getPrintStream());
        sw.start();
        if (!testSuite.isError()) {
            String msg = "Start: " + testSuite;
            log.info(msg);
            slr.info(msg);
View Full Code Here

Examples of loop.Context

  }

  @Override
  public FunctionDecl resolveFunctionOnStack(String fullyQualifiedName) {
    // First resolve in local scope if possible.
    Context context = scopes.peek();
    if (context != null) {
      FunctionDecl func = context.localFunctionName(fullyQualifiedName);
      if (func != null)
        return func;

      // Look for recursion only if a local function did not hide us.
      if (fullyQualifiedName.equals(context.thisFunction.name()))
View Full Code Here

Examples of macromedia.asc.util.Context

      }
    }

    if (!(do_help || filespecFound))
    {
            Context cx = new Context(new ContextStatics());

      System.err.println(cx.errorString(ErrorConstants.kError_MissingFilespec));
      System.exit(1);
    }
    else if (do_help)
    {
      handleFile("","");
View Full Code Here

Examples of model.Context

     * @throws java.io.IOException
     * @throws java.lang.ClassNotFoundException
     */
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        QuestionList questionList = new QuestionList();
        Context context = null;
        int attempt = 0;
        int rightAnswers = 0;
        String result;

        ServerSocket server = new ServerSocket(24891);
        System.out.println("Server Started");
        Socket socket = server.accept();
        System.out.println("New client on port" + socket.getPort());
        ObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream());
        ObjectInputStream input = new ObjectInputStream(socket.getInputStream());
       
        while (true) {

            if (questionList.next() != null) {
                context = readQuestion(questionList.next());
            }
            output.writeObject(context);
            output.flush();
            context = (Context) input.readObject();

            attempt++;
            if (questionList.isRight(context.getVariant())) {
                result = "Congratulations! It is the right answer";
                rightAnswers++;
            } else {
                result = "It is the wrong answer";
            }
            result = result.concat(attempt % 10 == 0 ? (" " + rightAnswers + "/" + attempt) : "");

            context.setResult(result);
            output.writeObject(context);
            output.flush();
        }
    }
View Full Code Here

Examples of net.arnx.jsonic.JSON.Context

final class FormatConverter implements Converter {
  public static final FormatConverter INSTANCE = new FormatConverter();
 
  public Object convert(JSON json, Context context, Object value, Class<?> c, Type t) throws Exception {
    Context context2 = json.new Context(context);
    context2.skipHint = true;
    value = json.preformatInternal(context2, value);
    StringBuilderOutputSource fs = new StringBuilderOutputSource(new StringBuilder(200));
    try {
      json.formatInternal(context2, value, fs);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.