Examples of Factory


Examples of org.jamesii.core.factories.Factory

      return new JLabel("No renderer found for null entry");
    }

    // Border border = null;

    Factory factory = null;
    try {
      factory = (Factory) Class.forName(value.getFactoryName()).newInstance();
    } catch (Exception e) {
      SimSystem.report(e);
      return null;
    }

    JPanel outerPanel = new JPanel(new BorderLayout());

    applyTemplate(template, outerPanel);

    // if (border != null) {
    // outerPanel.setBorder(border);
    // }

    JLabel nameLabel = new JLabel(factory.getReadableName());
    nameLabel.setFont(font);
    nameLabel.setForeground(foreground);
    nameLabel.setBackground(background);
    nameLabel.setOpaque(false);
    outerPanel.add(nameLabel, BorderLayout.PAGE_START);

    // retrieve parameters
    Map<String, ParameterBlock> parameters =
        value.getParameters().getSubBlocks();

    // the panel that holds the parameter summary
    Box innerPanel = new Box(BoxLayout.PAGE_AXIS);
    innerPanel.setBackground(background);
    innerPanel.setOpaque(false);
    innerPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    innerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));

    for (Entry<String, ParameterBlock> param : parameters.entrySet()) {
      String paramName = param.getKey();
      String paramText;
      Object paramVal = param.getValue().getValue();
      paramText = paramVal != null ? paramVal.toString() : "(null)";
      if (paramVal instanceof String) {
        try {
          Factory fac =
              (Factory) Class.forName((String) paramVal).newInstance();
          paramText = fac.getReadableName();
        } catch (Exception e) {
          SimSystem.report(e);
        }
      }
View Full Code Here

Examples of org.jboss.dashboard.factory.Factory

     * Init the advanced configuration subsystem based in the Factory trees.
     */
    protected void initFactory() {
        if (Application.lookup().getGlobalFactory() == null) {
            String factoryCfgDir = Application.lookup().getBaseCfgDirectory() + "/" + FACTORY_CONFIG_DIR;
            Factory factory = Factory.getFactory(new File(factoryCfgDir));
            if (factory != null) Application.lookup().setGlobalFactory(factory);
        }
        ComponentsContextManager.addComponentStorage(Component.SCOPE_REQUEST, new RequestComponentsStorage());
        ComponentsContextManager.addComponentStorage(Component.SCOPE_PANEL_SESSION, new PanelSessionComponentsStorage());
        ComponentsContextManager.addComponentStorage(Component.SCOPE_SESSION, new SessionComponentsStorage());
View Full Code Here

Examples of org.jboss.test.xb.builder.object.type.xmltransient.support.Factory

      super(name);
   }

   public void testUnmarshal() throws Exception
   {
      Factory factory = unmarshalObject(Factory.class);

      assertEquals(FactoryBean.class.getName(), factory.getClassName());
      assertEquals(Object.class.getName(), factory.getBeanClassName());
   }
View Full Code Here

Examples of org.jclouds.compute.callables.RunScriptOnNode.Factory

   @SuppressWarnings({ "unchecked", "rawtypes" })
   @Test
   public void testStartVboxConnectsToManagerWhenPortAlreadyListening() throws Exception {
      VirtualBoxManager manager = createMock(VirtualBoxManager.class);
      Factory runScriptOnNodeFactory = createMock(Factory.class);
      RunScriptOnNode runScriptOnNode = createMock(RunScriptOnNode.class);
      RetryIfSocketNotYetOpen client = createMock(RetryIfSocketNotYetOpen.class);
      HardcodedHostToHostNodeMetadata hardcodedHostToHostNodeMetadata = createMock(HardcodedHostToHostNodeMetadata.class);
      NodeMetadata host = new NodeMetadataBuilder().id("host").status(Status.RUNNING).build();
      URI provider = URI.create("http://localhost:18083/");
View Full Code Here

Examples of org.jclouds.http.functions.ParseSax.Factory

                 null, "allow", "Server Tier Firewall Rule", false, "Icmp-ping")));*/
 
   public void test() {
      InputStream is = getClass().getResourceAsStream("/firewallService.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      FirewallService result = factory.create(injector.getInstance(FirewallServiceHandler.class)).parse(is);
      assertEquals(result.isEnabled(), false);
      assertEquals(
            result.getFirewallRules(),
            ImmutableSet.<FirewallRule> of(
                FirewallRule.builder().firewallType("SERVER_TIER_FIREWALL").isEnabled(false).source("internet")
View Full Code Here

Examples of org.jooq.impl.Factory

    private static final JooqLogger log = JooqLogger.getLogger(SybaseDatabase.class);

    @Override
    public Factory create() {
        return new Factory(getConnection(), SQLDialect.SYBASE);
    }
View Full Code Here

Examples of org.jvnet.hk2.annotations.Factory

* @author Kohsuke Kawaguchi
*/
public class Creators {
    @SuppressWarnings("unchecked")
    public static <T> Creator<T> create(Class<T> c, Habitat habitat, MultiMap<String,String> metadata) {
        Factory f = c.getAnnotation(Factory.class);
        if (f != null) {
            return new FactoryCreator<T>(c,f.value(),habitat,metadata);
        }

        Inhabitant factory = habitat.getInhabitantByAnnotation(FactoryFor.class, c.getName());
        if (factory!=null) {
            return new FactoryCreator<T>(c,factory,habitat,metadata);
View Full Code Here

Examples of org.mockito.cglib.proxy.Factory

                    + "If you're not sure why you're getting this error, please report to the mailing list.", e);
        }
    }
   
    private Object createProxy(Class<?> proxyClass, final MethodInterceptor interceptor) {
        Factory proxy = (Factory) objenesis.newInstance(proxyClass);
        proxy.setCallbacks(new Callback[] {interceptor, NoOp.INSTANCE});
        return proxy;
    }
View Full Code Here

Examples of org.objectweb.fractal.adl.Factory

        components[QM_COMPONENT_IDX] = children[i].getFcInterface("query-manager");
      } else if ("tpm".equals(name)) {
        components[TPM_COMPONENT_IDX] = children[i].getFcInterface("transactional-persistence-manager");
      }
    }
    Factory factory = FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND);
    Map ctxt = new HashMap();
    ctxt.put("template", "true");
    pmT = (Component) factory.newComponent(pmTemplate, ctxt);
    tT = (Component) factory.newComponent(txTemplate, ctxt);
  }
View Full Code Here

Examples of org.opengis.referencing.Factory

            final Collection<?> dep = ((ReferencingFactory) factory).dependencies();
            if (dep != null) {
                for (final Object element : dep) {
                    final MutableTreeNode child;
                    if (element instanceof Factory) {
                        final Factory candidate = (Factory) element;
                        if (!done.add(candidate)) {
                            continue;
                        }
                        child = createTree(candidate, done);
                        if (!done.remove(candidate)) {
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.