⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alsbconfigurationmbean.html

📁 一个实用的java源程序
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 </pre> <h2>Changing environment values</h2> The following code shows two ways of changing environment values. Environment values can be changed either via the find-and-replace feature, or individually. While the former is more convenient the latter provides more control.  <p> <pre> // change environment values that differ between domains. // we simply change the string "localhost" to "productionhost" // in all the URIs EnvValueQuery evquery =     new EnvValueQuery(         null,        // search across all resource types         Collections.singleton(EnvValueTypes.SERVICE_URI), // search only the URIs         null,        // search across all projects and folders.         true,        // only search across resources that are                      // actually modified/imported in this session         "localhost", // the string we want to replace         false        // not a complete match of URI. any URI                      // that has "localhost" as substring will match         ); //create a customization object for finding and replacing an environment value FindAndReplaceCustomization replaceCust = new FindAndReplaceCustomization("Find and Replace service uri",evquery, "productionhost"); List<Customization> custList = new ArrayList<Customization>(); custList.add(replaceCust); //customize now alsbSession.customize(custList); // perform an even finer grained environment value replacement. // replace all file paths/URLs that start with "file:///c:/" and // replace with "file:///c:/{project/folder of the resource}, // essentially making the file structure confirm to the project // structure // find all env values in all resources that have been modified in // the sessionevquery = new EnvValueQuery(null, null, null, true, null, false);ArrayList<QualifiedEnvValue> envValuesToChange = new ArrayList<QualifiedEnvValue>();String prefix = "file:///c:/";for (QualifiedEnvValue qev : alsbSession.findEnvValues(evquery)) {    if (qev.getValue() instanceof String && qev.getValue().toString().startsWith(prefix)) {        Ref ref = qev.getOwner();        String oldValue = (String) qev.getValue();        String newValue = oldValue.substring(0, prefix.length()) +            ref.getFullName() + // insert "/" separated path for the resource            "/" + oldValue.substring(prefix.length());        QualifiedEnvValue newEnvValue =            new QualifiedEnvValue(qev.getOwner(),                                  qev.getEnvValueType(),                                  qev.getLocation(),                                  newValue);        envValuesToChange.add(newEnvValue);        System.out.println("Env value " + qev.getOwner() + " : " + qev.getEnvValueType() +                           " : " + qev.getLocation() + " : " + qev.getValue() +                           " will be changed to " + newValue);    }}//Create a customization to assign a new set of env valuesEnvValueCustomization envCust = new EnvValueCustomization("Assign env values", envValuesToChange);custList.clear();custList.add(envCust);// customize nowalsbSession.customize(custList); </pre> <h2>Querying resources</h2> This mbean also allows querying resources based on certain criteria. The queries can be performed over the core (activated) data, or in a session, in which case the session view of the configuration will be used to return the query result. The following code shows a simple query that returns all WSDL based "http" services.<p> <pre> ALSBConfigurationMBean alsbCore = getConfigMBean(null); ProxyServiceQuery query = new ProxyServiceQuery(); // find all proxy services using http transport and WSDL based query.setTransportScheme("http"); query.setWSDLBasedService(true); Set<Ref> refs = alsbCore.getRefs(query); System.out.println("Resources that satisfy the search criteria are:"); for (Ref ref : refs) {     System.out.println(ref); } </pre>
<P>

<P>
<HR>

<P>
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#NAME">NAME</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#TYPE">TYPE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#clone(com.bea.wli.config.Ref, com.bea.wli.config.Ref)">clone</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&nbsp;sourceRef,
      <A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&nbsp;targetRef)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clones a given source project, folder or resource with a new identity.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#createFolder(com.bea.wli.config.Ref, java.lang.String)">createFolder</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&nbsp;folderRef,
             <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;description)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a folder with the given reference and description.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#createProject(com.bea.wli.config.Ref, java.lang.String)">createProject</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&nbsp;projectRef,
              <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;description)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a project with the given reference, and project description.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#customize(java.util.List)">customize</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/List.html" title="class or interface in java.util">List</A>&lt;<A HREF="../../../../../../com/bea/wli/config/customization/Customization.html" title="class in com.bea.wli.config.customization">Customization</A>&gt;&nbsp;customizations)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This API supports multiple customizations at one place.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#delete(java.util.Collection)">delete</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&gt;&nbsp;refs)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deletes the given collection of references.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#exists(com.bea.wli.config.Ref)">exists</A></B>(<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&nbsp;ref)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if an entity exists in the domain.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#export(java.util.Collection, boolean, java.lang.String)">export</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&gt;&nbsp;refsToExport,
       boolean&nbsp;includeDependencies,
       <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;passphrase)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exports the given collection of references and returns bytes that make up the export data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#exportProjects(java.util.Collection, java.lang.String)">exportProjects</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../../../com/bea/wli/config/Ref.html" title="class in com.bea.wli.config">Ref</A>&gt;&nbsp;projectrefs,
               <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;passphrase)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Export resources at the project level.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../../../com/bea/wli/config/env/QualifiedEnvValue.html" title="class in com.bea.wli.config.env">QualifiedEnvValue</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../com/bea/wli/sb/management/configuration/ALSBConfigurationMBean.html#findEnvValues(com.bea.wli.config.env.EnvValueQuery)">findEnvValues</A></B>(<A HREF="../../../../../../com/bea/wli/config/env/EnvValueQuery.html" title="class in com.bea.wli.config.env">EnvValueQuery</A>&nbsp;query)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Searches environment specific values based on the given query</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -