mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-24 00:21:11 -04:00
Rework state and license checks
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
package io.xpipe.core.process;
|
||||
|
||||
public interface OsNameState {
|
||||
|
||||
String getOsName();
|
||||
}
|
||||
@@ -56,10 +56,10 @@ public interface ShellControl extends ProcessControl {
|
||||
|
||||
String getOsName();
|
||||
|
||||
boolean isLicenseCheck();
|
||||
|
||||
ReentrantLock getLock();
|
||||
|
||||
void requireLicensedFeature(String id);
|
||||
|
||||
ShellDialect getOriginalShellDialect();
|
||||
|
||||
void setOriginalShellDialect(ShellDialect dialect);
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.extern.jackson.Jacksonized;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@SuperBuilder(toBuilder = true)
|
||||
@Jacksonized
|
||||
public class ShellStoreState extends DataStoreState implements OsNameState {
|
||||
public class ShellStoreState extends DataStoreState implements SystemState {
|
||||
|
||||
OsType.Any osType;
|
||||
String osName;
|
||||
|
||||
@@ -6,6 +6,11 @@ public class StubShellControl extends WrapperShellControl {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHaveSubshells() {
|
||||
return parent.canHaveSubshells();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {}
|
||||
}
|
||||
|
||||
12
core/src/main/java/io/xpipe/core/process/SystemState.java
Normal file
12
core/src/main/java/io/xpipe/core/process/SystemState.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package io.xpipe.core.process;
|
||||
|
||||
public interface SystemState {
|
||||
|
||||
OsType getOsType();
|
||||
|
||||
String getOsName();
|
||||
|
||||
ShellDialect getShellDialect();
|
||||
|
||||
ShellTtyState getTtyState();
|
||||
}
|
||||
@@ -112,13 +112,13 @@ public class WrapperShellControl implements ShellControl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLicenseCheck() {
|
||||
return parent.isLicenseCheck();
|
||||
public ReentrantLock getLock() {
|
||||
return parent.getLock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReentrantLock getLock() {
|
||||
return parent.getLock();
|
||||
public void requireLicensedFeature(String id) {
|
||||
parent.requireLicensedFeature(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user