Package nexj.core.meta.j2ee

Examples of nexj.core.meta.j2ee.J2EEResourceRef


   */
  protected void addResourceRefs(Channel channel, int nContainer, List list)
  {
    if (channel.isSendable())
    {
      J2EEResourceRef ref = new J2EEResourceRef("tcp/" + channel.getName(),
          SysUtil.NAMESPACE + "/tcp/" + channel.getName(),
          SysUtil.PACKAGE + ".core.rpc.tcp.TCPConnectionFactory");

      // Non-transactional connections cannot be shareable
      ref.setShareable(false);
      ref.setConnectionPoolPartitioned(true);
      ref.setResourceAdapterName(getResourceAdapterName(channel));
      ref.setMaxConnections(((TCPChannel)channel).getMaxSenders());
      list.add(ref);
    }
  }
View Full Code Here


            if (db.isEnabled())
            {
               for (Iterator itr = db.getFragmentIterator(); itr.hasNext();)
               {
                  RelationalDatabaseFragment fragment = (RelationalDatabaseFragment)itr.next();
                  J2EEResourceRef ref =  new J2EEResourceRef("jdbc/" + db.getName() + fragment.getSuffix(),
                     SysUtil.NAMESPACE + "/jdbc/" + fragment.getAlias(),
                     "javax.sql.DataSource", fragment.getUser());

                  // assume nexj.core.rpc.sql.ra.SQLManagedConnectionFactory
                  if (nPart == XMLMetadataExporter.J2EE_PLATFORM_CONNECTION_FACTORY)
                  {
                     if (!fragment.isFirst())
                     {
                        continue;
                     }

                     RelationalDatabase ds = (RelationalDatabase)fragment.getDataSource();
                     SQLAdapter adapter = (SQLAdapter)ds.getComponent().getInstance(null);
                     String sDataSourceClass = ds.getDriver();

                     ref.addProperty(new J2EEProperty("name", ds.getName()));
                     ref.addProperty(new J2EEProperty("dataSource", sDataSourceClass));
                     ref.addProperty(new J2EEProperty("initialSQL", adapter.getInitialSQL()));
                     ref.addProperty(new J2EEProperty("password", fragment.getPassword()));
                     ref.addProperty(new J2EEProperty("properties",
                           PropertyUtil.toString(fragment.getPropertyHolder().getProperties())));
                     ref.addProperty(new J2EEProperty("statementCacheSize", fragment.getStatementCacheSize()));
                     ref.addProperty(new J2EEProperty("testSQL", adapter.getTestSQL()));
                     ref.addProperty(new J2EEProperty("user", fragment.getUser()));
                     ref.addProperty(new J2EEProperty("isolationLevel",
                                                      Connection.TRANSACTION_READ_COMMITTED));
                  }

                  ref.setIsolationLevel(Connection.TRANSACTION_READ_COMMITTED);
                  m_exporter.exportJ2EEResourceRef(ref, nPart, sNamespace, nContainer, nContext);
               }
            }

            break;
View Full Code Here

   protected void addResourceRefs(Channel channel, int nContainer, List list)
   {
      if (channel.isSendable())
      {
         FileChannel fc = (FileChannel)channel;
         J2EEResourceRef ref = new J2EEResourceRef("file/" + channel.getName(),
            SysUtil.NAMESPACE +  "/file/" + channel.getName(),
            SysUtil.PACKAGE + ".core.rpc.file.FileConnectionFactory");

         ref.setResourceAdapterName(getResourceAdapterName(fc));
         ref.setTxMode(J2EEResourceRef.TX_XA);
        
         ref.setShareable(true);

         ref.addProperty(new J2EEProperty("inputConnection", false));
         ref.addProperty(new J2EEProperty("outgoingDirectory", fc.getOutgoingDirectory()));
         ref.addProperty(new J2EEProperty("outgoingTempDirectory", fc.getTemporaryDirectory()));
         ref.addProperty(new J2EEProperty("journalDirectory", fc.getOutgoingJournalPath()));
         ref.setMaxConnections(((FileChannel)channel).getMaxSenders());

         list.add(ref);
      }
   }
View Full Code Here

TOP

Related Classes of nexj.core.meta.j2ee.J2EEResourceRef

Copyright © 2018 www.massapicom. 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.