Examples of ControlException


Examples of com.sun.enterprise.admin.common.exception.ControlException

            return null;
        }
        catch(Exception e)
        {
            sLogger.log(Level.WARNING, "mbean.security_check_failed", e);
            throw new ControlException(e.getMessage());
        }
    }
View Full Code Here

Examples of com.sun.enterprise.admin.common.exception.ControlException

                i++;
            }
        }
        catch (Exception e)
        {
            throw new ControlException(e.getMessage());
        }
        ManagedInstanceTimer tt = new ManagedInstanceTimer(
            TIME_OUT_SECONDS, 0,
            new TimerCallback()
            {
                public boolean check() throws Exception
                {
                    return (rmiClient.getInstanceStatusCode() ==
                            Status.kInstanceRunningCode);
                }
            } );
        tt.run(); //synchronous

        if (rmiClient.getInstanceStatusCode() != Status.kInstanceRunningCode)
        {
      String msg = localStrings.getString( "admin.server.core.mbean.config.timeout_while_restarting_server" );
            try
            {
                stop(TIME_OUT_SECONDS);
            }
            catch (ControlException ce)
            {
                msg += localStrings.getString( "admin.server.core.mbean.config.server_stop_exception" );
            }
            throw new ControlException(msg + mInstanceName);
        }

        return reqId;
    }
View Full Code Here

Examples of com.sun.enterprise.admin.common.exception.ControlException

    timeoutReached = (timeAfter - timeBefore) >= timeoutMillis;
      }
      if (timeoutReached) {
                sLogger.log(Level.INFO, "mbean.stop_instance_timeout", mInstanceName);
        String msg = localStrings.getString( "admin.server.core.mbean.config.timeout_while_stopping_server", mInstanceName );
              throw new ControlException( msg );
      } else {
    sLogger.log(Level.INFO, "mbean.stop_instance_success", mInstanceName);
      }
      //
        }
        catch (Exception e)
        {
            sLogger.log(Level.SEVERE,
                    "mbean.stop_instance_failed", mInstanceName);
            throw new ControlException(e.getMessage());
        }
        /* calling stop script*/
    }
View Full Code Here

Examples of com.sun.enterprise.admin.common.exception.ControlException

            }
            catch (Exception e)
            {
                sLogger.finest
                ("Problem with getting port:ManagedServerInstance:getStatus");
                throw new ControlException(e.getLocalizedMessage());
            }
        }
        sLogger.exiting(getClass().getName(), "getStatus",
                        status.getStatusString()); //noi18n
        return ( status );
View Full Code Here

Examples of com.sun.enterprise.admin.common.exception.ControlException

            // Error generated during parsing)
            Exception  x = sxe;
            if (sxe.getException() != null)
                x = sxe.getException();
            sLogger.throwing(getClass().getName(), "createDocument", x);
            throw new ControlException(x.getLocalizedMessage());
           
        }
        catch (ParserConfigurationException pce)
        {
            // Parser with specified options can't be built
            sLogger.throwing(getClass().getName(), "createDocument", pce);
            throw new ControlException(pce.getLocalizedMessage());
        }
        catch (IOException ioe)
        {
            // I/O error
            sLogger.throwing(getClass().getName(), "createDocument", ioe);
            throw new ControlException(ioe.getLocalizedMessage());
        }
        return document;
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

                //
                // Spring doesn't provide any mechanism to pass dynamic constructor args
                // to Spring bean factory methods.
                //
                if (props != null)
                    throw new ControlException("Providing a PropertyMap to the bean constructor is not supported by SpringControlFactory");
            }
            else
            {
                //
                // Fall back to using standard Java instantation if no Spring configuration
                // could be found.
                // TODO: Have a configuration option where this results in a failure, to avoid
                // masking misconfiguration issues if the expectation is that all usage of
                // Controls is configured via Spring.
                //
                bean = super.instantiate(beanClass, props, context, id);
            }
        }
        catch (Exception e)
        {
            throw new ControlException("Exception creating ControlBean", e);
        }

        return bean;
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

        //
        if (remoteHome != null)
        {
            if (localHome != null)
            {
                throw new ControlException(controlInterface +
                                           " extends multiple EJB home interfaces.");
            }
            _homeInterface = getRoot(remoteHome, derivesFrom);
        }
        else if (localHome != null)
        {
            _homeInterface = getRoot(localHome, derivesFrom);
        }
        else
        {
            throw new ControlException(controlInterface +
                " does not extend the EJBHome or EJBLocalHome interfaces");
        }

        if (remoteBean != null)
        {
            if (localBean != null)
            {
                throw new ControlException("Interface " + controlInterface +
                            " extends multiple EJB object interfaces.");
            }
            _beanInterface = getRoot(remoteBean, derivesFrom);
        }
        else if (localBean != null)
        {
            _beanInterface = getRoot(localBean, derivesFrom);
        }
        else
        {
            throw new ControlException("Interface " + controlInterface +
             " does not extend the EJBObject or EJBLocalObject interfaces");
        }

        // Identify the bean type via bean interface reflection
        _beanType = "Session";
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

        // cache the Map.get method for efficiency
        try {
            _methodMapGet = java.util.Map.class.getMethod("get", new Class[]{Object.class});
        } catch (NoSuchMethodException e) {
            throw new ControlException("Can not find java.util.Map.get(Object) method");
        }
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

                                        _implClass.getName() + "Initializer");
                _implInitializer = (ImplInitializer)initClass.newInstance();
            }
            catch (Exception e)
            {
                throw new ControlException("Control initialization failure", e);
            }
        }
        return _implInitializer;
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

                // annotation, else downstream requirements (such as having a valid control init
                // class) will not be met.
                //
                if (_implClass.getAnnotation(ControlImplementation.class) == null)
                {
                    throw new ControlException("@org.apache.beehive.controls.api.bean.ControlImplementation annotation is missing from control implementation class: " + _implClass.getName());
                }
            }
            catch (ClassNotFoundException cnfe)
            {
                throw new ControlException("Unable to load control implementation: "  + implBinding, cnfe);
            }

            //
            // Cache the threading policy associated with the impl
            //
            Threading thr = (Threading)_implClass.getAnnotation(Threading.class);
            if ( thr != null )
                _threadingPolicy = thr.value();
            else
                _threadingPolicy = ThreadingPolicy.SINGLE_THREADED;    // default to single-threaded

            ensureThreadingBehaviour();

            try
            {
                //
                // Create and initialize the new instance
                //
                _control = _implClass.newInstance();

                try
                {
                    getImplInitializer().initialize(this, _control);
                    _hasServices = true;
                }
                catch (Exception e)
                {
                    throw new ControlException("Control initialization failure", e);
                }

                //
                // Once the control is initialized, then allow the associated context
                // to do any initialization.
                //
                ControlBeanContext cbcs = (ControlBeanContext)getBeanContextProxy();
                cbcs.initializeControl();
            }
            catch (RuntimeException re) { throw re; }   // never mask RuntimeExceptions
            catch (Exception e)
            {
                throw new ControlException("Unable to create control instance", e);
            }
        }

        //
        // If the implementation instance does not currently have contextual services, they
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.