8000 Adds a rule about CORBA by agoncal · Pull Request #1008 · windup/windup-rulesets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adds a rule about CORBA #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

< 8000 /details-dialog>
Merged
merged 3 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 chang 8000 es: 37 additions & 0 deletions rules/rules-reviewed/cloud-readiness/java-corba.windup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<ruleset id="java-corba"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<metadata>
<description>
This ruleset detects CORBA invocations, which is problematic when migrating an application to a cloud environment.
</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final"/>
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final"/>
</dependencies>
<sourceTechnology id="java"/>
<targetTechnology id="cloud-readiness"/>
<tag>corba</tag>
</metadata>
<rules>
<rule id="java-corba-00000">
<when>
<or>
<javaclass references="com.sun.corba.{*}"/>
<javaclass references="org.omg.CORBA.{*}"/>
<javaclass references="com.iona.corba.{*}"/>
</or>
</when>
<perform>
<hint title="CORBA" effort="5" category-id="cloud-optional">
<message>
Common Object Request Broker Architecture (CORBA) found in the application. CORBA is not recommended in cloud environments. Try to replace it with a more modern technology.
</message>
<tag>corba</tag>
</hint>
</perform>
</rule>
</rules>
</ruleset>
< 8000 tr data-hunk="7541334fdbaec3949b49b1dc872219a03940522c4e21f2c779ce061c3ba3cd29" class="show-top-border">
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import com.iona.corba.util.SystemExceptionDisplayHelper;

import java.io.*;
import java.util.*;

public class Client
{

public static void main(String args[])
{
java.util.Properties props = System.getProperties();
props.put("org.omg.CORBA.ORBClass", "com.iona.corba.art.artimpl.ORBImpl");
props.put("org.omg.CORBA.ORBSingletonClass", "com.iona.corba.art.artimpl.ORBSingleton");

ORB orb = ORB.init(args, props);

System.out.println("initializing ORB");

try
{
orb23 = (org.omg.CORBA_2_3.ORB)orb;

if (!readCommandLineArguments(args))
{
usage();
return;
}

System.out.println("retrieving exported Bank reference");

String ior = null;
Bank bank = null;

System.out.println("reading stringified object reference from file");


InputStreamReader osr=new InputStreamReader(fis);
BufferedReader br=new BufferedReader(osr);
ior = br.readLine();
br.close();

System.out.println("calling ORB::string_to_object");
System.out.println("IOR is :"+ior);
org.omg.CORBA.Object o = orb.string_to_object(ior);

System.out.println("narrowing CORBA::Object");
bank = BankHelper.narrow(o);

BankMenu bank_menu = new BankMenu(bank, sm_is_interactive);
bank_menu.run();

try
{
if (!sm_is_interactive)
{
for (int i = 0; i < BankMenu.sm_account_names.length; i++)
{
// Remove database files
//
}
}
}
finally
{
orb.shutdown(true);
}
}
catch (SystemException ex) {
System.err.println("Exception during string_to_object() or narrow()");
System.out.println(SystemExceptionDisplayHelper.toString(ex));
System.exit(0);
}
catch (java.io.IOException io_exc)
{
System.err.println("IOException during string_to_object() or narrow()");
io_exc.printStackTrace();
System.exit(0);
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruletest id="java-corba-test"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<testDataPath>data/corba</testDataPath>
<rulePath>../java-corba.windup.xml</rulePath>
<ruleset>
<rules>
<rule id="java-corba-00000">
<when>
<not>
<iterable-filter size="3">
<hint-exists message="Common Object Request Broker Architecture"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="CORBA hint was not found!"/>
</perform>
</rule>
</rules>
</ruleset>
</ruletest>
0