/** * Gets the handler info. * @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo() */ public Element getHandlerInfo() { Element root = super.getHandlerInfo(); if (m_subscribersDescriptions != null) { for (int i = 0; i < m_subscribersDescriptions.length; i++) { Element description = m_subscribersDescriptions[i]; root.addElement(description); } } return root; } }
/** * Returns the current handler description. * The simplest description contains only the name and the validity of the handler. * If the handler override this method, it can customize the description. * By default, this method returns the simplest description. * @return the description of the handler. */ public HandlerDescription getDescription() { return new HandlerDescription(this); }
/** * Gets a handler description by specifying the handler qualified name. * This method ignores case of the given handler name. * @param handler the handler name * @return the handler description or <code>null</code> if not found */ public HandlerDescription getHandlerDescription(String handler) { for (HandlerDescription description : m_handlers) { if (description.getHandlerName().equalsIgnoreCase(handler)) { return description; } } return null; }
private static String extractInvalidityReason(InstanceDescription description) { // As it generally comes from the @Requires, let's have a look DependencyHandlerDescription deps = (DependencyHandlerDescription) description.getHandlerDescription("org.apache.felix.ipojo:requires"); if (deps != null && !deps.isValid()) { for (DependencyDescription dd : deps.getDependencies()) { if (dd.getState() == DependencyModel.UNRESOLVED) { if (dd.getSpecification().equals(Template.class.getName())) { // View case return "Missing template : " + extractTemplateName(dd.getFilter()); } else if (dd.getSpecification().equals(Crud.class.getName())) { // Crud case return "Missing model : " + extractModelName(dd.getFilter()); } // General case return "Missing service : " + dd.getSpecification(); } } } // It's not the dependency handler for (HandlerDescription hd : description.getHandlers()) { if (!hd.isValid()) { return "Invalid handler " + hd.getHandlerName(); } } return ""; }
/** * Gets handler information. * This represent the actual state of the handler. * @return the handler information. */ public Element getHandlerInfo() { Element elem = new Element("Handler", ""); elem.addAttribute(new Attribute("name", m_handlerName)); if (isValid()) { elem.addAttribute(new Attribute("state", "valid")); } else { elem.addAttribute(new Attribute("state", "invalid")); } return elem; }
/** * Gets handler information. * This represent the actual state of the handler. * @return the handler information. */ public Element getHandlerInfo() { Element elem = new Element("Handler", ""); elem.addAttribute(new Attribute("name", m_handlerName)); if (isValid()) { elem.addAttribute(new Attribute("state", "valid")); } else { elem.addAttribute(new Attribute("state", "invalid")); } return elem; }
/** * Gets the handler info. * @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo() */ public Element getHandlerInfo() { Element root = super.getHandlerInfo(); if (m_subscribersDescriptions != null) { for (int i = 0; i < m_subscribersDescriptions.length; i++) { Element description = m_subscribersDescriptions[i]; root.addElement(description); } } return root; } }
/** * Returns the current handler description. * The simplest description contains only the name and the validity of the handler. * If the handler override this method, it can customize the description. * By default, this method returns the simplest description. * @return the description of the handler. */ public HandlerDescription getDescription() { return new HandlerDescription(this); }
/** * Gets a handler description by specifying the handler qualified name. * This method ignores case of the given handler name. * @param handler the handler name * @return the handler description or <code>null</code> if not found */ public HandlerDescription getHandlerDescription(String handler) { for (HandlerDescription description : m_handlers) { if (description.getHandlerName().equalsIgnoreCase(handler)) { return description; } } return null; }
Element services = super.getHandlerInfo(); for (int i = 0; i < m_providedServices.length; i++) { Element service = new Element("provides", null);
handlerDesc = new HandlerDescription(); handlerDesc.setHandler(this); handlerDesc.setName(this.getName()); return handlerDesc;
Element services = super.getHandlerInfo(); for (int i = 0; i < m_providedServices.length; i++) { Element service = new Element("provides", null);
/** * Gets handler information. * * @return the handler information. */ public Element getHandlerInfo() { Element elem = super.getHandlerInfo(); elem.addAttribute(new Attribute("registered", Boolean .toString(m_handler.isRegistered()))); elem.addAttribute(new Attribute("objectName", m_handler .getUsedObjectName())); if (m_handler.isUsesMOSGi()) { String foundStr = null; if (m_handler.isMOSGiExists()) { foundStr = "found"; } else { foundStr = "not_found"; } elem.addAttribute(new Attribute("mosgi", foundStr)); } return elem; } }
Element services = super.getHandlerInfo(); for (int i = 0; i < m_imports.size(); i++) { ServiceImporter imp = (ServiceImporter) m_imports.get(i);
Element services = super.getHandlerInfo(); for (int i = 0; i < m_services.size(); i++) { ProvidedService svc = (ProvidedService) m_services.get(i);
Element services = super.getHandlerInfo(); for (int i = 0; i < m_services.size(); i++) { ProvidedService svc = (ProvidedService) m_services.get(i);
Element services = super.getHandlerInfo(); for (int i = 0; i < m_imports.size(); i++) { ServiceImporter imp = (ServiceImporter) m_imports.get(i);
Element elem = super.getHandlerInfo();
Element elem = super.getHandlerInfo();
/** * Gets the handler description. * @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo() */ public Element getHandlerInfo() { Element root = super.getHandlerInfo(); for (int i = 0; i < m_publishersDescriptions.size(); i++) { PublisherDescription p = (PublisherDescription) m_publishersDescriptions.get(i); Element publisher = new Element("Publisher", ""); publisher.addAttribute(new Attribute("name", p.getName())); publisher.addAttribute(new Attribute("synchronous", String.valueOf(p.isSynchronous()))); publisher.addAttribute(new Attribute("data_key", p.getDataKey())); Element topics = new Element("Topics", ""); if (p.getTopics() != null) { for (int j = 0; j < p.getTopics().length; j++) { String topic = p.getTopics()[j]; Element e_topic = new Element("topic",""); topics.addElement(e_topic); e_topic.addAttribute(new Attribute("name",topic)); } } publisher.addElement(topics); root.addElement(publisher); } return root; }