Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ public synchronized byte[] getBytes(org.omg.CORBA.ORB orb)
return array.clone() ;
}

public ServerRequestDispatcher getServerRequestDispatcher()
{
return oktemp.getServerRequestDispatcher( id ) ;
@Override
public ServerRequestDispatcher getServerRequestDispatcher() {
return oktemp.getServerRequestDispatcher(id);
}

@Override
public String toString() {
return getClass().getSimpleName() + "[id=" + id + "]";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2026 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -35,95 +36,94 @@
/**
* @author Ken Cavanaugh
*/
public class WireObjectKeyTemplate implements ObjectKeyTemplate
{
private ORB orb ;
private static final IORSystemException wrapper =
IORSystemException.self ;
private static ObjectAdapterId NULL_OBJECT_ADAPTER_ID =
new ObjectAdapterIdArray( new String[0] ) ;
public class WireObjectKeyTemplate implements ObjectKeyTemplate {

@Override
public boolean equals( Object obj )
{
if (obj == null) {
return false ;
}
private static final IORSystemException WRAPPER = IORSystemException.self;
private static final ObjectAdapterId NULL_OBJECT_ADAPTER_ID = new ObjectAdapterIdArray(new String[0]);

return obj instanceof WireObjectKeyTemplate ;
}
private ORB orb;

@Override
public int hashCode()
{
return 53 ; // All WireObjectKeyTemplates are the same, so they should
// have the same hashCode.
public WireObjectKeyTemplate(ORB orb) {
this.orb = orb;
}

public WireObjectKeyTemplate( ORB orb )
{
initORB( orb ) ;
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
return obj instanceof WireObjectKeyTemplate;
}

private void initORB( ORB orb )
{
this.orb = orb ;
@Override
public int hashCode() {
return 53; // All WireObjectKeyTemplates are the same, so they should
// have the same hashCode.
}

public void write( ObjectId id, OutputStream os )
{
byte[] key = id.getId() ;
os.write_octet_array( key, 0, key.length ) ;
@Override
public void write(ObjectId id, OutputStream os) {
byte[] key = id.getId();
os.write_octet_array(key, 0, key.length);
}

public void write( OutputStream os )
{
@Override
public void write(OutputStream os) {
// Does nothing
}

public int getSubcontractId()
{
return ORBConstants.DEFAULT_SCID ;
@Override
public int getSubcontractId() {
return ORBConstants.DEFAULT_SCID;
}

// While it might make sense to throw an exception here, this causes
// problems since we need to check whether unusual object references
// are local or not. It seems that the easiest way to handle this is
// are local or not. It seems that the easiest way to handle this is
// to return an invalid server id.
public int getServerId()
{
return -1 ;
@Override
public int getServerId() {
return -1;
}

public String getORBId()
{
throw wrapper.orbIdNotAvailable() ;
@Override
public String getORBId() {
throw WRAPPER.orbIdNotAvailable();
}

public ObjectAdapterId getObjectAdapterId()
{
return NULL_OBJECT_ADAPTER_ID ;

// throw wrapper.objectAdapterIdNotAvailable() ;
@Override
public ObjectAdapterId getObjectAdapterId() {
return NULL_OBJECT_ADAPTER_ID;
}


// Adapter ID is not available, since our
// ORB did not implement the object carrying this key.
public byte[] getAdapterId()
{
throw wrapper.adapterIdNotAvailable() ;
@Override
public byte[] getAdapterId() {
throw WRAPPER.adapterIdNotAvailable();
}


@Override
public ORBVersion getORBVersion() {
return ORBVersionFactory.getFOREIGN();
}

public ORBVersion getORBVersion()
{
return ORBVersionFactory.getFOREIGN() ;

@Override
public ServerRequestDispatcher getServerRequestDispatcher(ObjectId id) {
byte[] bid = id.getId();
String str = new String(bid);
return orb.getRequestDispatcherRegistry().getServerRequestDispatcher(str);
}

public ServerRequestDispatcher getServerRequestDispatcher( ObjectId id )
{
byte[] bid = id.getId() ;
String str = new String( bid ) ;
return orb.getRequestDispatcherRegistry().getServerRequestDispatcher(
str ) ;
@Override
public String toString() {
Comment thread
dmatej marked this conversation as resolved.
return getClass().getSimpleName()
+ "[subcontractId=" + getSubcontractId()
+ " serverId=" + getServerId()
+ " objectadapterId=" + getObjectAdapterId()
+ "]";
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2026 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -60,17 +61,6 @@ public boolean initialize()
return true;
}

////////////////////////////////////////////////////
//
// Implementation.
//

@Override
protected String toStringName()
{
return "SocketFactoryAcceptorImpl";
}

// Fix for 6331566.
// This Acceptor must NOT contribute alternate IIOP address components
// to the standard IIOPProfileTemplate,
Expand Down
30 changes: 16 additions & 14 deletions orbmain/src/main/java/com/sun/corba/ee/impl/misc/ORBUtility.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2026 Contributors to the Eclipse Foundation
* Copyright (c) 2019 Payara Services Ltd.
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -41,6 +42,7 @@
import java.io.IOException ;
import java.io.PrintStream ;
import java.io.Serializable;
import java.lang.System.Logger;
import java.net.SocketAddress ;
import java.nio.ByteBuffer ;
import java.nio.channels.SocketChannel ;
Expand Down Expand Up @@ -68,35 +70,35 @@
import org.omg.CORBA.portable.InputStream ;
import org.omg.CORBA.portable.OutputStream ;

import static java.lang.System.Logger.Level.DEBUG;

/**
* Handy class full of static functions that don't belong in util.Utility for pure ORB reasons.
*/
public final class ORBUtility {
private static final Logger LOG = System.getLogger(ORBUtility.class.getName());

/** Utility method for working around leak in SocketChannel.open( SocketAddress )
* method.
* @param sa address to connect to
* @return The opened channel
* @throws java.io.IOException If an I/O error occurs
* @see SocketChannel#connect(java.net.SocketAddress)
*/
public static SocketChannel openSocketChannel( SocketAddress sa )
throws IOException {

SocketChannel sc = SocketChannel.open() ;

public static SocketChannel openSocketChannel(SocketAddress sa) throws IOException {
LOG.log(DEBUG, "openSocketChannel({0})", sa);
SocketChannel sc = SocketChannel.open();
try {
sc.connect( sa ) ;
return sc ;
} catch (RuntimeException | IOException exc ) {
sc.connect(sa);
return sc;
} catch (RuntimeException | IOException exc) {
try {
sc.close() ;
sc.close();
} catch (IOException ioe) {
// Ignore this: close exceptions are useless.
exc.addSuppressed(ioe);
}

throw exc ;
throw exc;
}

}

private static final ThreadLocal<LinkedList<Byte>> encVersionThreadLocal =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2026 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -61,6 +62,7 @@
import com.sun.corba.ee.spi.transport.SocketInfo;
import com.sun.corba.ee.spi.transport.TransportDefault ;

import java.lang.System.Logger;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.AccessController ;
Expand All @@ -69,7 +71,10 @@
import org.glassfish.pfl.basic.func.NullaryFunction;
import org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory;

import static java.lang.System.Logger.Level.TRACE;

public class ORBConfiguratorImpl implements ORBConfigurator {
private static final Logger LOG = System.getLogger(ORBConfiguratorImpl.class.getName());
private static final ORBUtilSystemException wrapper =
ORBUtilSystemException.self ;

Expand Down Expand Up @@ -99,8 +104,10 @@ public PropertyParser makeParser()
}
}

public void configure( DataCollector collector, ORB orb )
@Override
public void configure( DataCollector collector, ORB orb )
{
LOG.log(TRACE, "configure(collector, orb)");
ORB theOrb = orb ;

initObjectCopiers( theOrb ) ;
Expand Down
Loading